Show: Object Pascal C++
Display Preferences


From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function FileGetDate(Handle: THandle): LongInt;


extern DELPHI_PACKAGE int __fastcall FileGetDate(NativeUInt Handle);


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


Returns an OS time stamp for a specified file.

Use FileGetDate to determine the timestamp of a file, given its handle.

The return value is -1 if the handle is invalid.

The FileDateToDateTime function can be used to convert the returned value to a TDateTime value.

Note: FileGetDate uses a file handle rather than a native Object Pascal file variable. To obtain the timestamp of a file that has not been opened using the FileOpen or FileCreate method, use the FileAge function instead.
Note: On MacOS, -1 is always a valid timestamp. Use FileExists instead, to verify that the file does or does not exist.

See Also

Code Examples

Personal tools