473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Mapping network drive on Linux

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
2 3627
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Leo R | last post by:
Hi, Is it possible to create a network-drive at the SYSTEM-level? E.g.: map X: to \\server1\share so a windows service can reach X: without having to log on? I want a Windows .NET service to...
0
by: Michael Hauer | last post by:
Hi, First my system(s): We want to migrate one server from NT 4.0 to Linux (small company). Clients are NT + XP. The application is .NET 1.0 and all clients run 1.0 SP3. A network drive...
1
by: Johan | last post by:
My problem is that I want to set file permission on a file on the network using WMI, but the folder might not be mapped which ,as far as I know, WMI needs. So my solution to this would be to map...
0
by: Rob | last post by:
Hi, Does anyone know of a good reference for mapping a network drive programmatically using VB.Net? Is it best to use API calls or is there a better way to do it? Thanks Rob
2
by: Tomas Vera | last post by:
Hello All, I have a web application that is required to copy a file from the WebServer to a remote web server (staging server to production server). I've created an application that maps the...
13
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I am actually trying to get the UNC path of the main module of a process running from a mapped drive, and I am trying to do this from a service. The ProcessModule class only provides the full path...
10
by: =?Utf-8?B?Z3JlYXRiYXJyaWVyODY=?= | last post by:
Sorry about that previous one. I pressed enter too early. How does one go about mapping a network drive in C#. i know you use MapNetworkDrive in scripting languages, but i'm not sure how to do it...
0
by: Daffydd | last post by:
Hi all, This one's driving me up a wall! We have a small office network, Windows SBS 2003, nothing fancy - recently upgraded from an old Compaq running Novell. Back in the day we used the "F"...
4
by: james457 | last post by:
Hi all, I am writing a linux testbed for wireless sensor networks. The core objective is to test data transfer between any two nodes. The network runs using tree topology. One node in the network...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.