Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ashokformac

macrumors member
Original poster
Mar 26, 2007
34
0
I am using java on mac os 10.4

i want to access a file on LAN server machine.how can i give the server path...ie for local file i just give direct filename ie ..

/system/ashok/temp.txt

but suppose i want to access a file on server machine (eg. is-s234) and file name is temp.txt

for thi9s how can i write the filepath ...


thanks in advance ...
 
I'm just guessing here (I've never touched Java), but possibly afp://is-s234/system/ashok/temp.txt.
 
I would have thought it would just be is-s234/system/ashok/temp.txt. But I'm sure you tried that already. Or maybe it's /Volumes/is-s234/system/ashok/temp.txt.

Anyway, a quick trick is to launch a Terminal window, then navigate to the file in Finder, and drag-and-drop the file into the finder window. The full path to the file will appear in the terminal window.
 
I don't know Java, but you need to find a way to mount the network volume. then the file should be in /Volumes/<mounted Network volume name>/system/ashok/temp.txt.

Assuming that the remote machine is a Mac, you should be able to use AFP to mount the HD of that machine.
 
you are right but i want the file (only for reading) without mounting on the finer ..


thanks in advance..
 
you are right but i want the file (only for reading) without mounting on the finer ..


thanks in advance..

It doesn't matter what you want the file for. If you want to access a file that is being served via ANY network method either:

1) The OS has to provide access for you. On Mac OSX this means mounting that file system.

2) Your code has to be able to talk the protocol required and provide all it's own access. Java does not know how to talk AFS (or CIFS even) so you are looking at writing this all yourself or mounting the filesystem.
 
ashokformac, take some time to learn and research instead of looking for handouts from other forum members.

If you want to access files over a network, look into libraries that might help you such as JCIFS, http://jcifs.samba.org/. This assumes that server is using CIFS/SMB protocols. I'm sure there are others for other protocols.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.