2
votes

I'm a newbie to FTP. I want to create a folder if it doesn't exists already. I know there is an option "mkdir -p foldername", but doing this in ftp creates a folder by the name "-p". I'm trying to transfer files from one remote server to another via ftp and create folders in receiving server if not already present.

1

1 Answers

3
votes

One solution would be to always attempt to create the folder - and then ignore any errors. Of course, after creating the folder you need to cd into it - if that gives an error then you've got bigger problems.

The -p option in the shell mkdir is there to ensure no error is raised. FTP doesn't use the shell: it does it for itself.