FtpSetFileTime Function  
 
INT WINAPI FtpSetFileTime(
  HCLIENT hClient,  
  LPCTSTR lpszFileName,  
  LPSYSTEMTIME lpFileTime  
);

The FtpSetFileTime function sets the modification time for the specified file on the server.

Parameters

hClient
Handle to the client session.
lpszFileName
Points to a string that specifies the name of the remote file.
lpFileTime
Points to a SYSTEMTIME structure that specifies the new modification time for the remote file.

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 FtpSetFileTime function will change the modification time of a file on the server. The values specified in the SYSTEMTIME structure are expected to represent UTC time, not time adjusted for the local system's timezone. If the values do represent the local time, it must be converted to UTC time prior to calling this function. To populate the SYSTEMTIME structure with the current time, use the GetSystemTime function.

When connected to an FTP server, this function uses the MDTM command to set the modification time for the specified file. Not all servers implement this command, in which case the function call will fail. Note that some servers only support the MDTM command to return, but not change, the file modification time.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csftpv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also