Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mapping network drive on Linux

0 views
Skip to first unread message

Thierry Lam

unread,
Aug 31, 2005, 3:05:26 PM8/31/05
to
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

Steve M

unread,
Aug 31, 2005, 3:18:39 PM8/31/05
to
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'.

Robert Kern

unread,
Aug 31, 2005, 3:22:10 PM8/31/05
to pytho...@python.org

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
rk...@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

0 new messages