Skip to main content

TrFile_GetTimeCreated (function reference)

Troi File Plug-in > Functions reference > TrFile_GetTimeCreated
Troi File Plug-in for FileMaker Pro

TrFile_GetTimeCreated

Returns the creation time for the file specified by the filePath.

SyntaxFunction badge

TrFile_GetTimeCreated ( switches ; filePath )

Parameters

switches not used, reserved for future use. Leave blank or put "-Unused"
filePath the path to the file for which you want the information

Returned Result

Data type returned

Time

Result

The returned result is the creation time of the file. The time is in the same format as a time field (number of seconds since 00:00:00).

An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:

$$-43 fnfErr File not found, check if the path is valid
$$-1 genericErr The file could not be found (older versions of the plug-in)

Other errors may be returned.

Originated in

Troi File Plug-in 1.0

Compatibility

FileMaker Pro 16 to FileMaker Pro 2023

Considerations

You can use FileMaker styled paths, like “filewin:/C:/MyFiles/test.txt”.

Example

Set Field [ creationTime ; TrFile_GetTimeCreated ( "-Unused" ;  "C:\Test.txt" ) ]

This might return the number 7264 which is equivalent to the time: 02:01:04.

Example 2

We assume that in your FileMaker file the following fields are defined:

  creationTime		time
  gFilePath		Global, text

gFilePath should contain the path to the file for example “D:\Logs\L01.TXT” (Windows) or “Mac HD:Logs:Log 1” (Mac). In a script add the following script step:

Set Field [ creationTime ; TrFile_GetTimeCreated ( "-Unused" ;  gFilePath ) ]

This will store the creation time of the file specified by gFilePath in the field creationTime.

Used in example file

DataIn.fmp12

Related functionsFunction badge

TrFile_GetTimeModified
TrFile_SelectFileDialog

Related topics

Troi File Plug-in online help (overview)


Online Help Page for Troi File Plug-in for 16 to 2023 –> TrFile_GetTimeCreated (filep4250) 2023-0601 15:39:33