Back to product page

MakeDir function


Creates a directory on the server.

Type

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

Syntax

  • C
long Sftp_MakeDir(void *Sftp, char *RemotePath);
The MakeDir(void *Sftp,char *RemotePath) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *RemotePathFull path to directory on the server.

Remarks

This function will create a directory on remote server, if possible. Once completed, 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 occurrs, the ErrorCode will hold the number of the error and ErrorText will contain a description of the error.

By definition, you should not expect the server to be able to create directories recursively. In other words, if you specify something like "/tmp/test/a/b/c" as the RemotePath and the directory "/tmp/test" does not exist , you should expect an error from the server. However, it is possible that some server-side implementations will support this capability.

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

Platforms

Windows