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 ...
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,680
4,111
New Zealand
I'm just guessing here (I've never touched Java), but possibly afp://is-s234/system/ashok/temp.txt.
 

iSee

macrumors 68040
Oct 25, 2004
3,539
272
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.
 

neoserver

macrumors 6502
Apr 24, 2003
335
0
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.
 

ashokformac

macrumors member
Original poster
Mar 26, 2007
34
0
you are right but i want the file (only for reading) without mounting on the finer ..


thanks in advance..
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.
 

jeremy.king

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
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.