Internet Direct (Indy)
Home
PreviousUpNext
TIdFTP.FileDate Method

Rtrieves the date and time a file was last modified on the remote system.

Pascal
function FileDate(
    const AFileName: String; 
    const AsGMT: Boolean = False
): TIdDateTime;
Parameters 
Description 
AFileName 
FIle name to examine for the last modification date and time.
 
AsGMT 
Indicates if the GMT date/time value is converted to the local timezone. The default value is False. 

TIdDateTime - Date and optional Time the file was last modified.

FileDate is a TIdDateTime function used to implement support for the FTP MDTM extension command. FileDate allows the FTP client to access the File Modification Time for a specified file on FTP servers that implement the MDTM feature. 

Use the Capabilities property to determine if the FTP server supports the MDTM feature, although some server may support MDTM even when it does not support the FTP FEAT command. 

FileDate sends the FTP MDTM command using the value in AFilename as an argument, and expects the numeric response code 213 to indicate successful completion of the FTP command. When 500-series numeric responses are received, the return value for the method is set to 0.0 or the empty native TIdDateTime value. 

File modification time values returned from the FTP server are expressed in the GMT (Greenwich Mean Time) timezone. When AsGMT contains False, the file modification time value is converted to the local time zone for the FTP client. The return value will include the a date/time value that includes at a minimum the Year, Month, and Day the file was last modified. On some remote systems, the hour, minute, seconds, and milliseconds for the modification are also available. 

FileDate can be used independent of values available in responses to the FTP MLST or MLSD commands stored in either ListResult or DirectoryListing. Most FTP servers will return the same value in each of these scenarios.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.