FtpGetFileTime Function  
 
INT WINAPI FtpGetFileTime(
  HCLIENT hClient,  
  LPCTSTR lpszFileName,  
  LPSYSTEMTIME lpFileTime,  
  BOOL bLocalize  
);

The FtpGetFileTime function returns the modification time for the specified file on the server.

Parameters

hClient
Handle to the client session.
lpszFileName
Points to a null-terminated string that specifies the name of the remote file.
lpFileTime
Points to a SYSTEMTIME structure that will be set to the current modification time for the remote file.
bLocalize
A boolean flag which specifies if the file time is localized to the current timezone. If this value is non-zero, then the file time is adjusted to that the time is local to the current system. If this value is zero, the file time is returned in UTC time.

Return Value

If the function succeeds, the return value is the server result code. If the function fails, the return value is FTP_ERROR. To get extended error information, call FtpGetLastError.

Remarks

The FtpGetFileTime function can be used to determine the date and time that a file was last modified on the server. The time may either be localized to the current system, or it may be returned as UTC time. If you plan on changing the values returned in the SYSTEMTIME structure and then calling FtpSetFileTime function to modify the file time on the server, you should do not localize the time.

This function uses the MDTM command to determine the modification time of the specified file. If the server does not support this command, the function will attempt to use the STAT command to determine the file modification time.

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use csftpav7.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

FtpGetFileStatus, FtpOpenDirectory, FtpSetFileTime