network file path for mac os

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

  1. ashokformac macrumors member

    Joined:
    Mar 26, 2007
    #1
    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 ...
     
  2. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #2
    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

    Joined:
    Mar 26, 2007
    #3
    that is not working .....
    is there any other way ...

    thanks in advance
     
  4. iSee macrumors 68040

    iSee

    Joined:
    Oct 25, 2004
    #4
    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

    Joined:
    Apr 24, 2003
    #5
    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

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


    thanks in advance..
     
  7. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #7
    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

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
    #8
    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.
     

Share This Page