specifying paths in ftp put command

I can get put to work in an ftp session from the terminal but whenever i specify a path that has directories it says it can't find the file. For example
I set the terminal directory to /logs before opening the ftp session. i can then put a file that resides in the /logs folder by specifying it's name say x.html
If i set the terminal session directory to / before opening the ftp session though and try and put /logs/x.html i'm told that the file doesn't exist. I also have trouble using `/

so is there a bug in ftp or am i somehow misspecifying the paths? thanks!

G5 dual 2.7, Mac OS X (10.4.5)

Posted on Aug 9, 2006 9:44 PM

Reply
2 replies

Aug 9, 2006 11:28 PM in response to trinko

The ftp PUT command takes a path to the file on your local filesystem as its first argument and tries to put the file in the same relative location on the server.

So, for example, if you:

put /logs/x.html


It will try to the file to the /logs directory on the remote server. If there isn't a /logs server on the server then you'll fail.

If you just want to upload the local file /logs/x.html to the current directory on the remote server, say so:

put /logs/x.html x.html

Aug 10, 2006 4:07 AM in response to trinko

trinko,

welcome to the discssions here.

There isn't likely a bug in ftp.

Camelot covered two possibilities - the third (and most unlikely) is that /logs/x.html isn't a local file (wrong path, or missing file)

You can mkdir inside ftp to create /logs (assuming your user has lots of permissions over / - which generally is not the case) - better to log into the remote server to make sure the directory you are trying to write to exists and is writable by you...

You can test this by putting the file someplace safe (/tmp) that exists on many machines and is generally writable by anyone:
<pre>ftp otherserver
put /logs/x.html /tmp/x.html</pre>
If you need more help, please send the commands you use like I did above...

cheers, mike

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

specifying paths in ftp put command

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.