FtpGetFileStatus Function  
 
BOOL WINAPI FtpGetFileStatus(
  HCLIENT hClient,  
  LPCTSTR lpszFileName,  
  LPFTPFILESTATUS lpFileStatus  
);

The FtpGetFileStatus function returns information about a specific file on the server.

Parameters

hClient
Handle to the client session.
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 function succeeds, the return value is non-zero. If the function fails, the return value is zero. To get extended error information, call FtpGetLastError.

Remarks

This function uses the STAT command to retrieve information about the specified file. Unlike the FtpGetFirstFile and FtpGetNextFile functions, which read through a file list returned on the data channel, this function reads the result of a command string. For applications that need information about a specific file, using this function 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

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

FtpCloseDirectory, FtpGetDirectoryFormat, FtpGetFirstFile, FtpGetNextFile, FtpGetTransferStatus, FtpOpenDirectory, FtpSetDirectoryFormat