PDA

View Full Version : FTP from Terminal question




larswik
Sep 12, 2006, 07:04 PM
I was trying something else when I took a brain break from my Java. Since sending files from a Java app that I am working on using FTP I thought I would send a file to one of my other computers using the Terminal. I have a Unix book and it covers FTP and everything works fine.

But I have other drives attached to my computer. I was wanting to send a file that was located on an external drive that I have. the book only talks about sending stuff that is located from your root drive, ie. /Users/larsg5.

How do I get away from the Root Drive and to the external drive where the files are?

Thanks,

-Lars



jhu
Sep 12, 2006, 07:29 PM
if all you want is to transfer a file over, you'll have to find out where the drive is mounted. type 'mount' to see which directory the computer mounted the drive to. then just copy the file to that directory.

or are you writing a java program that does this?

larswik
Sep 12, 2006, 07:52 PM
Way down the road it will be a Java command calling this up since that is the type of program that I would like to try to write.

I typed in 'mount' like you said and this popped up

/dev/disk0s3 on /Volumes/SB Hotel (local, journaled)
/dev/disk0s5 on /Volumes/Backup stuff (local, journaled)
/dev/disk4 on /Volumes/Video Raid (local, journaled)
/dev/disk6s3 on /Volumes/VideoPod (local, nodev, nosuid, journaled)
automount -nsl [159] on /Network (automounted)
automount -fstab [163] on /automount/Servers (automounted)
automount -static [163] on /automount/static (automounted)
larsg5s-power-mac-g5:~ larsg5$

The file I want is located on the Video Raid. so how do I change from the video /Users/larsg5 to the video raid drive for FTP transfer?

I know I can move the file to the internal drive. But later when I have learned and built the app I would like to have a button be pressed and the computer to ask for the path to the folder where things will be kept.

-Lars

belvdr
Sep 12, 2006, 08:21 PM
Use lcd:

lcd "/Volumes/Video Raid"

That changes your host directory.

Alternatively, you could just put the file with the entire path:

put "Volumes/Video Raid/<filename>"

larswik
Sep 12, 2006, 09:55 PM
That is what I needed to know, tahnks.

-Lars