Mapping network drive on Linux

Discussion in 'Python' started by Thierry Lam, Aug 31, 2005.

  1. Thierry Lam

    Thierry Lam Guest

    On windows, if I want to map a network drive to a local drive on my
    computer, I do the following:

    data = {
    'remote' : '\\blah\data',
    'local' : 'Z:'
    }
    win32net.NetUseAdd(None, 1, data)


    How am I supposed to do similar thing on Linux?

    Thanks
    Thierry
     
    Thierry Lam, Aug 31, 2005
    #1
    1. Advertising

  2. Thierry Lam

    Steve M Guest

    You can approximate it by doing this at the command prompt:
    # mkdir /z
    #mount //blah/data /z

    I assume 'blah' is the hostname for a Windows machine and 'data' is the
    name of a share on blah. You might need to install smbfs and/or use
    'mount.smb' and/or use 'mount -t smbfs'. Of course this can all be done
    as a matter of Linux system administration and not as part of your
    python program. (To do it within Python, take the string you would type
    at the command prompt and call os.system() on it.)

    If my assumption is wrong then the answer depends on what you mean by
    'map a network drive to a local drive'.
     
    Steve M, Aug 31, 2005
    #2
    1. Advertising

  3. Thierry Lam

    Robert Kern Guest

    Thierry Lam wrote:
    > On windows, if I want to map a network drive to a local drive on my
    > computer, I do the following:
    >
    > data = {
    > 'remote' : '\\blah\data',
    > 'local' : 'Z:'
    > }
    > win32net.NetUseAdd(None, 1, data)
    >
    > How am I supposed to do similar thing on Linux?


    You would run the appropriate, external programs using os.system() or
    subprocess. As for what those might be, you will have to read your
    distribution's documentation or google around for HOWTOs.

    --
    Robert Kern


    "In the fields of hell where the grass grows high
    Are the graves of dreams allowed to die."
    -- Richard Harter
     
    Robert Kern, Aug 31, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon
    Replies:
    5
    Views:
    11,262
    Scott M.
    Jan 17, 2010
  2. mh
    Replies:
    4
    Views:
    719
    Wolfgang Strobl
    May 31, 2005
  3. Thierry Lam

    Mapping a drive to a network path

    Thierry Lam, Jul 22, 2005, in forum: Python
    Replies:
    3
    Views:
    303
    Thierry Lam
    Jul 22, 2005
  4. shailesh
    Replies:
    1
    Views:
    817
    Tim Golden
    Mar 28, 2007
  5. king
    Replies:
    1
    Views:
    293
Loading...

Share This Page