CFtpQueue::RemoveFile Method  
 
BOOL RemoveFile(
  DWORD dwFileId  
);
BOOL RemoveFile(
  LPCTSTR lpszFileName  
);

The RemoveFile method removes the specified file from the queue.

Parameters

dwFileId
An unsigned integer value which uniquely identifies the file in the queue. This value cannot be zero.
lpszFileName
A null-terminated string which specifies the name of the file to remove. If this version of the method is called, this parameter cannot be NULL or point to an empty string. The file name may include wildcard characters if you wish to remove multiple files. The character '?' will match against any single character, and '*' will match any number of characters.

Return Value

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

Remarks

Files can only be removed from the queue when in an idle or paused state. If you attempt to remove a file while the queue manager is in the process of uploading or download files, the method will fail.

The file identifier can be obtained by several different methods, including EnumFiles and GetStatus, which provides information about the current file being processed in the queue. Do not make any assumptions about the value of the identifier. Although the value is guaranteed to be unique for the specified queue, it is not guaranteed that file identifiers will be assigned in sequential order.

If you call this method using a file name, the EnumFiles method will be used to enumerate all remote file names which match and remove them from the queue. File name matches are not case-sensitive, even when matching against file names on servers which use case-sensitive naming, such as UNIX based servers.

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

See Also