File_TimeCreated()

Parent Previous Next

File_TimeCreated(bDay As Byte, bMonth As Byte, bYear As Byte, bHours As Byte, bMinutes As Byte, bSeconds As Byte)


bDay (Byte): The day of the month (1–31).

bMonth (Byte): The month (1–12).

bYear (Byte): The year, starting from 2000 (e.g., for 2024, use 24).

bHours (Byte): The hour in 24-hour format (0–23).

bMinutes (Byte): The minutes (0–59).

bSeconds (Byte): The seconds (0–59).


Set the Created Property of a File or Directory


File_TimeCreated() is used to set the "Created" timestamp for a file or directory. This timestamp reflects the date and time when the file or directory was created. The values set using File_TimeCreated() are applied when the file or directory is created, and this information is stored as part of its metadata.


Example:

File_TimeCreated(2,11,24, 21,32,55)


When to Use:

• Before creating a new file or directory: You can use File_TimeCreated() to specify the creation timestamp.

• Before calling file creation functions like File_Create(), File_CreateDir(), or similar commands to set the creation timestamp in advance.


Notes:

File_TimeCreated() should be used before calling the function to create a file or directory. The creation timestamp will be stored in the file or directory's metadata upon creation.

• This command does not affect existing files or directories. You can only set the "Created" timestamp for files or directories that are being created.


TftSetUp(0)                                                                                 'Set screen

TftResetScreen(BLACK)                                                                       'Reset screen

TftSetSndFont(0,0)                                                                          'Set Font0

While File_Init() <> cErrOK : Wend                                                          'Initialize SD Card

TftPrintSndString("Sd Initialization OK",1,0,0,1,GREEN,BLACK,0)                             'Confirm Initialize SD Card

File_TimeCreated(2,10,24,11,32,55)                                                          'Set file created property

While File_Create("pic.log") <> cErrOK : Wend                                               'Create pic.log

TftPrintSndString("pic.log create OK",1,0,1,1,GREEN,BLACK,0)                                'Confirm create Pic.log 

File_Close()                                                                                'Close pic.log

While File_Create("PiC1.TxT") <> cErrOK : Wend                                              'Create PiC1.TxT

TftPrintSndString("PiC1.TxT create OK",1,0,2,1,GREEN,BLACK,0)                               'Confirm create PiC1.TxT

File_Close()                                                                                'Close PiC1.TxT

File_CreateDir("MyFolder")                                                                  'Create MyFolder directory

TftPrintSndString("MyFolder create OK",1,0,3,1,GREEN,BLACK,0)                               'Confirm create MyFolder

File_CreateDir("Test")                                                                      'Create Test directory

TftPrintSndString("Test create OK",1,0,4,1,GREEN,BLACK,0)                                   'Confirm create Test





Created with the Personal Edition of HelpNDoc: Make CHM Help File Creation a Breeze with HelpNDoc