MakeDir

Declaration: TFtpConnection.MakeDir (Path: string): integer;
The method MakeDir creates the directory Path on the FTP server.

The function returns the following error codes:

 0 ... everything is OK
-2 ... source file not found
-3 ... cannot read file (access error)
-9 ... unspecified error

Hint 1: Most FTP servers are Unix-based. Thus the Path normally uses slashes (/) instead of backslashes (\) to separate directories. Failing to use the correct separation character will result in an error (-2).

Hint 2: Please note that MakeDir cannot create several subdirectory levels at once. Thus if you want to create a directory two ore more levels deeper than an existing one you have to call MakeDir several times.

Example: assuming that the directory "root" already exists you have to call MakeDir twice to create a directory "root/level1/level2":

MyFtp.MakeDir ('root/level1');
MyFtp.MakeDir ('root/level1/level2');