[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

FileAgeUTF8

Returns the last modification time for the file in FileDate format.

Declaration

Source position: lazfileutils.pas line 111

function FileAgeUTF8(

  const FileName: string

):LongInt;

Arguments

FileName

  

File name examined in the function.

Function result

Last modification time for the file in FileDate format.

Description

FileAgeUTF8 is a Longint 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 is in FileDate format, and can be transformed to a TDateTime value with the FileDateToDateTime function.


Version 3.2 Generated 2024-02-25 Home