CFtpClient::GetFileStatus Method  
 
BOOL GetFileStatus(
  LPCTSTR lpszFileName,  
  LPFTPFILESTATUS lpFileStatus  
);

The GetFileStatus method returns information about a specific file on the server.

Parameters

lpszFileName
A pointer to a string which contains the name of the file that status information will be returned on. The file name cannot contain any wildcard characters.
lpFileStatus
A pointer to an FTPFILESTATUS structure which contains information about the file returned by the server.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

This method uses the STAT command to retrieve information about the specified file. Unlike the GetFirstFile and GetNextFile methods, which read through a file list returned on the data channel, this method reads the result of a command string. For applications that need information about a specific file, using this method can be considerably faster than iterating through all of the files in a given directory. Note that not all servers support using the command in this way.

On some systems, the STAT command will not return information on files that contain spaces or tabs in the filename. In this case, the FTPFILESTATUS structure members will be empty strings and zero values.

Requirements

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

See Also

CloseDirectory, GetDirectoryFormat, GetFirstFile, GetNextFile, GetTransferStatus, OpenDirectory, SetDirectoryFormat