LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ftp drive (https://www.linuxquestions.org/questions/linux-newbie-8/ftp-drive-888519/)

ust 06-27-2011 01:26 AM

ftp drive
 
I want to write a script to ftp to windows ( the script will run on linux ) to get data , can advise if the default drive is c: , now I want to change to another drive eg. d: , what can i do ?

Thanks.

TB0ne 06-27-2011 10:11 AM

Quote:

Originally Posted by ust (Post 4396629)
I want to write a script to ftp to windows ( the script will run on linux ) to get data , can advise if the default drive is c: , now I want to change to another drive eg. d: , what can i do ?
Thanks.

You can modify your script to change to the new drive, that's what you can do. Since you don't post your script, or give any real details, what do you expect anyone to be able to tell you??? Read the man pages for the FTP command.

dudeman41465 06-27-2011 10:28 AM

What FTP server is running on Windows?
Do you have the other drives added to the FTP server so it will actually let you cd into them?

ust 06-28-2011 09:44 PM

Quote:

Originally Posted by TB0ne (Post 4396942)
You can modify your script to change to the new drive, that's what you can do. Since you don't post your script, or give any real details, what do you expect anyone to be able to tell you??? Read the man pages for the FTP command.

my script is still in development , so I am not prefer to upload it to here.

The requirement is simple , when I login to the windows ftp server , the initial path is c:\Document and setting\.... , now I want to change to another directory eg. d drive , what can I do ?

I have tried d:\ or cd d:\tmp , all is not work .

Thanks.

TB0ne 06-29-2011 11:00 AM

Quote:

Originally Posted by ust (Post 4398621)
my script is still in development , so I am not prefer to upload it to here.

Then how do you expect anyone to help you with it?
Quote:

The requirement is simple , when I login to the windows ftp server , the initial path is c:\Document and setting\.... , now I want to change to another directory eg. d drive , what can I do ? I have tried d:\ or cd d:\tmp , all is not work .
Again, without your script, we can't help, especially if you don't provide any details. Just saying "all is not work", tells us nothing. From the man pages for FTP, along with thousands of references you can find from Google, both the "cd" and "lcd" commands work just fine for what you're trying to do.

You don't mention if you're using expect or not, how you're getting/putting files, or what you're trying to accomplish.

jefro 06-29-2011 03:24 PM

I could be wrong on this but a ftp server would provide access to some folder in windows. You may be allowed to traverse up a bit but usually you can't change drives. Set the ftp on windows to provide default folder on D:\ somewhere instead.

TB0ne 06-29-2011 03:54 PM

Quote:

Originally Posted by jefro (Post 4399505)
I could be wrong on this but a ftp server would provide access to some folder in windows. You may be allowed to traverse up a bit but usually you can't change drives. Set the ftp on windows to provide default folder on D:\ somewhere instead.

Hmm...you may be correct there. From some other FTP scripts I've seen, though, you *SHOULD* be able to do a "cd d:\somefolder". However, I didn't consider Windows folder permissions, and how Windows FTP may work. The OP hasn't posted any real details, though.

Wim Sturkenboom 06-30-2011 03:01 AM

You still haven't indicated which ftp server you're using in Windows. Because that is where you must set it up before it even can work. See also post #3 by dudeman41465

I did a quick check on filezilla: http://wiki.filezilla-project.org/FA...lla_Server_FAQ ; search for drive and it explains it.

Note:
To my knowledge, the ftp protocol does not know about drives, only folders.

frieza 06-30-2011 11:17 AM

indeed, as far as i know an ftp server works in the same manner as a web server, you provide it with a folder to use a 'document root' and ftp clients can't usually get any higher up the tree then that and drive letters are irrelevant to ftp clients.

schneidz 06-30-2011 12:24 PM

i think the limitation on windows is that the d:\ root isnt on the same directory tree as c:\ .

so i think it will be impossible to change drives (unless windows has some hack where you can mount the d:\ drive under c:\ or some clever symlinks/ shortcuts).

or you can chroot jail the host's ftp server to look at d:\ instead.

opinion: this is probably why most servers tend to run on linux/ unix because you can have multiple drives mounted in one directory tree (might i also suggest scp since ftp is horribly deprecated and insecure).


All times are GMT -5. The time now is 12:00 AM.