TrFile_GetTimestampModified |
Returns the modification date and time for the file specified by the filePath. The modification date and time are also displayed in the Finder or Explorer.
Syntax
TrFile_GetTimestampModified ( 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
Timestamp
Result
The returned result is the modification 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.
Originated in
Troi File Plug-in 1.0
Compatibility
FileMaker Pro 17 to FileMaker Pro 21 (2024)
Considerations
You can use FileMaker styled paths, like “filewin:/C:/MyFiles/test.txt”.
Example
Set Field [ result ; TrFile_GetTimestampModified ( "-Unused" ; "C:\Test.txt" ) ]
This may return the result: “2000-12-31 15:55:17”.
Example 2
We assume that in your FileMaker file the following fields are defined:
modificationDateTime text
gFilePath Global, text
gFilePath should contain the path to the file, for example “D:\Logs\L2000_01.TXT” (Windows) or “Mac HD:Logs:Log 2000_01” (Mac). In a script add the following script step:
Set Field [ modificationDateTime ; TrFile_GetTimestampModified ( "-Unused" ; gFilePath ) ]
This will store the modification date and time of the file specified by gFilePath in the field modificationDateTime.
Used in example file
Attribute.fmp12
Related functions
TrFile_GetDateModified |
TrFile_SelectFileDialog |
TrFile_SetTimestampModified |
Related topics
Troi File Plug-in online help (overview)