Back to product page

RemoveDir function


Removes a directory from the server.

Type

A Long value. If successful, 0 is returned, otherwise error as specified here

Syntax

  • C
long Sftp_RemoveDir(void *Sftp, char *RemotePath);
The RemoveDir(void *Sftp) syntax has these parts:
void *SftpHandle of the created Sftp instance.

Remarks

This function will remove a directory on the remote server, if possible. Once the remove is complete, the Done callback will be invoked. If no error occurs, the ErrorCode argument in the Done callback will be set to 0 (zero). If an error occurs, ErrorCode will hold the number of the error and ErrorText will contain a description of the error.

If the remote directory contains files or subdirectories - it is possible (and the most common behavior) that you will be not be able to remove it. This depends on the server's implementation of this command.

No wildcards can be used for the RemotePath argument. The RFC protocol specification for SFTP does not allow them.

Platforms

Windows