Returns the creation date and time for the file specified by the filePath.
TrFile_GetTimestampCreated ( switches ; filePath )
|switches||not used, reserved for future use. Leave blank or put "-Unused"|
|filePath||the path to the file for which you want the information|
Data type returned
The returned result is the creation date and time of the file. The result is formatted like this:
YYYY-MM-DD HH:MM:SS. Store the result in a text field.
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.
Troi File Plug-in 1.0
FileMaker Pro 16 to 19
You can use FileMaker styled paths, like “filewin:/C:/MyFiles/test.txt”.
Set Field [ result ; TrFile_GetTimestampCreated ( "-Unused" ; "C:\Test.txt" ) ]
This may return the result: “2000-02-22 15:55:17”.
We assume that in your FileMaker file the following fields are defined:
creationDateTime text gFilePath Global, text
gFilePath should contain the path to the file, for example “D:\Logs\L01.TXT” (Windows) or
“Mac HD:Logs:Log File 1” (Mac). In a script add the following script step:
Set Field [ creationDateTime ; TrFile_GetTimestampCreated ( "-Unused" ; gFilePath ) ]
This will store the creation date and time of the file specified by gFilePath in the field creationDateTime.
Used in example file