Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Mapping network drive on Linux

Reply
Thread Tools

Mapping network drive on Linux

 
 
Thierry Lam
Guest
Posts: n/a
 
      08-31-2005
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

 
Reply With Quote
 
 
 
 
Steve M
Guest
Posts: n/a
 
      08-31-2005
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'.

 
Reply With Quote
 
 
 
 
Robert Kern
Guest
Posts: n/a
 
      08-31-2005
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
http://www.velocityreviews.com/forums/(E-Mail Removed)

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapping A Network Drive On My Home Network From Another Location Fred Atkinson Cisco 4 02-18-2008 03:08 PM
how to check whether a drive is a network drive or drive from attached hard-disk shailesh Python 1 03-28-2007 12:57 PM
Mapping network drive Windwatcher Wireless Networking 5 05-09-2006 08:04 PM
Mapping network drive Kwyjibo MCSE 2 04-21-2004 08:07 PM
Mapping users to a network drive on a microsoft server cromi Computer Support 2 09-06-2003 01:32 PM



Advertisments