network file path for mac os

Discussion in 'Mac Programming' started by ashokformac, May 3, 2007.

  1. ashokformac macrumors member

    Mar 26, 2007
    I am using java on mac os 10.4

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


    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 ...
  2. Nermal Moderator


    Staff Member

    Dec 7, 2002
    New Zealand
    I'm just guessing here (I've never touched Java), but possibly afp://is-s234/system/ashok/temp.txt.
  3. ashokformac thread starter macrumors member

    Mar 26, 2007
    that is not working .....
    is there any other way ...

    thanks in advance
  4. iSee macrumors 68040


    Oct 25, 2004
    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.
  5. neoserver macrumors 6502

    Apr 24, 2003
    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.
  6. ashokformac thread starter macrumors member

    Mar 26, 2007
    you are right but i want the file (only for reading) without mounting on the finer ..

    thanks in advance..
  7. robbieduncan Moderator emeritus


    Jul 24, 2002
    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.
  8. jeremy.king macrumors 603


    Jul 23, 2002
    Fuquay Varina, 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, This assumes that server is using CIFS/SMB protocols. I'm sure there are others for other protocols.

Share This Page