Sign in Join
FPDoc Onlineexperiment

FileAgeUTF8 function

In unit LazFileUtils

Returns the last modification time for the file as an Int64 value.

Declaration

pascal
function FileAgeUTF8(const FileName: string): Int64

Arguments

FileName

File name examined in the function.

Function result

Last modification time for the file as an Int64 value.

Description

FileAgeUTF8 is an Int64 function which returns the last modification time for the file specified in FileName. FileAgeUTF8 should not be used on directories; it returns -1 if FileName represents a directory instead of a file.

For UNIX-like environments, the return value is provided by the FileAge function in the SysUtils unit. For Windows, FindFirstFileW is used to get the TWin32FindDataW data for the specified file. Its ftLastWriteTime value is converted using WinToDosTime to get the return value for the function.

The return value can be transformed to a TDateTime value with the FileDateToDateTime function.

Modified in LCL 5.0 to return an Int64 value instead of a LongInt value.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.