By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

Mapping network drive on Linux

P: n/a
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

Aug 31 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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'.

Aug 31 '05 #2

P: n/a
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
rk***@ucsd.edu

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

Aug 31 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.