Mapping network drive on Linux

T

Thierry Lam

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
 
S

Steve M

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'.
 
R

Robert Kern

Thierry said:
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
(e-mail address removed)

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top