WebFtpRemoveDirectory Function

Action

Removes the specified directory on the FTP server.

Include file

WebAPI.bdh

Syntax

WebFtpRemoveDirectory( in hFtp       : number, 
                       in sDirectory : string ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hFtp Valid handle to an FTP session. This handle must have been returned from a previous call to WebFtpConnect.
sDirectory String that contains the name of the directory to remove on the remote system. This can be either a fully qualified path or a name relative to the current directory.
注: Use WebFtpGetCurrentDirectory to determine the remote site's current working directory, instead of assuming that the remote system uses a hierarchical naming scheme for directories. The lpszDirectory parameter can be either partially or fully qualified file names relative to the current directory. A backslash (\) or forward slash (/) can be used as the directory separator for either name. WebFtpRemoveDirectory translates the directory name separators to the appropriate character before they are used.

Example

// Create and remove a directory on the FTP server. 
dcltrans 
  transaction TWebFtpDir 
  var
    hFtp: number; 
  begin
    WebFtpConnect(hFtp, "standardhost", WEB_PORT_FTP, 
                 "anonymous", "mymail@address.com");
    WebFtpCreateDirectory(hFtp, "/test_directory"); 
    WebFtpRemoveDirectory(hFtp, "/test_directory");
    WebFtpShutdown(hFtp); 
  end TWebFtpDir;

Sample scripts

WebMulti01.bdf

SilkEssential sample

Ftp.sep