Retrieves the file date and time properties of a remote file, enumerated using WebFtpFindFirstFile/WebFtpFindNextFile functions.
WebAPI.bdh
WebFtpGetFileTime( in hFtp : number,
out uDate : number,
out uTime : number,
in eTime : number): boolean;
true if successful
false otherwise
| Parameter | Description |
|---|---|
| hFtp | Valid handle to an FTP session. This handle must have been returned from a previous call to WebFtpConnect. |
| uDate | Variable that receives the file date property with format YYYYMMDD. |
| uTime | Variable that receives the file time property of the current day in seconds. |
| eTime | Specifies which file time property should be retrieved. The following options are supported:
|
dcltrans
transaction TGetFileSize
var
hFtp : number;
fFileSize : float;
nDate : number;
nTime : number;
sFileName : string;
sDateTime : string;
begin
WebFtpConnect(hFtp, "localhost", WEB_PORT_FTP, "user", "pass");
WebFtpFindFirstFile(hFtp, "testfile.txt", sFileName);
WebFtpGetFileSize(hFtp, fFileSize);
Print("The file " + sFileName + " has " + fFileSize + " bytes.");
WebFtpGetFileTime(hFtp, nDate, nTime, WEB_FTP_FILETIME_MODIFIED);
FormatDateTime(nDate, nTime, "%Y-%m-%d %H:%M:%S", sDateTime);
Print(sFilename + " modified time is " + sDateTime);
WebFtpShutdown(hFtp);
end TGetFileSize;