473,549 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

connection to samba server

hi,
does anyone knows how to connect to samba server (from windows)

thx in adv.
Przemo
Jul 18 '05 #1
7 4923
Przemo Drochomirecki wrote:
hi,
does anyone knows how to connect to samba server (from windows)

Yes.

Also, read http://www.catb.org/~esr/faqs/smart-questions.html

--Irmen

Jul 18 '05 #2
very funny, ok, so now it sounds like this:
(damn smart way)

I used Google to try to find "connecting to samba server"" on the Web, but I
got no useful hits. Does anyone know where I can find programming
information on this problem?

- Przemo
Jul 18 '05 #3
On Sun, 14 Dec 2003 03:33:31 -0800, "Przemo Drochomirecki" <pe******@gazet a.pl> wrote:
very funny, ok, so now it sounds like this:
(damn smart way)

I used Google to try to find "connecting to samba server"" on the Web, but I
got no useful hits. Does anyone know where I can find programming
information on this problem?

Which problem is your problem? Do you have a samba server running? On what?
Do you have privileges to configure it (even though you don't have sufficient
knowledge at this point)? What version of windows are you running? What connects
the two? Are you trying to connect with a program or browsing "network neighborhood"?
What makes you think there is a problem? What have you tried/observed? Why are we
playing 20-questions?

Regards,
Bengt Richter
Jul 18 '05 #4
There's a task:
1) connect to linux samba server from windows application
2) compare files from samba server with files from choosen windows
catalog(s)
3) make backup if it's necessary.

So my problem is how to make connection with samba server having triple (IP
server, login, password) and download/upload
files. I'm working on Wk2. I was searching for suitable library but found
nothing.

Regards
Przemek Drochomirecki
Jul 18 '05 #5
Przemo Drochomirecki wrote in message ...
There's a task:
1) connect to linux samba server from windows application
After <5 minutes of googling, and knowing nothing about windows programming,
it seems that the function you need is WNetAddConnecti on2:

http://msdn.microsoft.com/library/de...us/wnet/wnet/w
netaddconnectio n2.asp

There is a (very popular) Python package out there which exposes the win32
api. I'm not sure what it's called. (win32api? pythonwin? win32all?)
2) compare files from samba server with files from choosen windows
catalog(s)
What's a windows catalog?
3) make backup if it's necessary.

So my problem is how to make connection with samba server having triple (IP
server, login, password) and download/upload
files. I'm working on Wk2. I was searching for suitable library but found
nothing.


You need the share name, too, I think, not just server/login/password.

Given what I think you want to do (it's not crystal clear), shouldn't you be
using rsync? My guess is that you have a bunch of windows clients and you
want to back them all up to a linux server out there somewhere. Rsync lives
for this stuff. Random Google for rsync on windows:
http://optics.ph.unimelb.edu.au/help...rsync_pc1.html Hey, look! Rsync
is hosted by samba! http://rsync.samba.org/
There's also a port of rsync to python and java (presumably, so you don't
need cygwin?) Don't know how useful they are, or if they can interop.

Why isn't the network share always connected to the windows clients? That
way you wouldn't need to back up clients to a server, but just the one
server (whose shares all the windows clients mount) to some other
server/media/drive/whatever, and you can keep all that backup machinery in a
*nix environment. This is far less complex, no?

Of course, I don't administer windows clients in big, heterogeneous
networks, so feel free to ignore my babblings.
--
Francis Avila

Jul 18 '05 #6
Francis Avila wrote:
After <5 minutes of googling, and knowing nothing about windows programming,
it seems that the function you need is WNetAddConnecti on2:

http://msdn.microsoft.com/library/de...us/wnet/wnet/w
netaddconnectio n2.asp

There is a (very popular) Python package out there which exposes the win32
api. I'm not sure what it's called. (win32api? pythonwin? win32all?)


win32all:

http://starship.python.net/crew/mhammond/win32/

but I'm pretty sure you can use os.system("net use ...") as well...

</F>


Jul 18 '05 #7
"Przemo Drochomirecki" <pe******@gazet a.pl> wrote...
does anyone knows how to connect to samba server (from windows)


Hello there.

Your question isn't particularly clear, however I can assume you mean
something more like "can anyone help me establish a connection to a
Samba server from Python under Windows?"

In which case, the clearest solution might be to use a suitable
Windows API call to map the remote Samba computer's share to a local
drive letter, then just access the remote Samba files via that drive
letter, eg.:

def map_drive(local , remote, username = None, password = None):
return win32wnet.WNetA ddConnection2(
win32netcon.RES OURCETYPE_DISK,
local, remote, None,
username, password,
0
)

def unmap_drive(... ):
...

map_drive("Z:", r"\\mum\my_shar e")
# <use os.listdir to determine contents of Z:, and process>
unmap_drive("Z: ")
Alternatively if your share does not require authentication (ie. you
are pre-authenticated to the Samba server, or it has guest shares),
you may directly use UNC pathnames to access the share, eg.:

# will throw 'invalid argument' if you are not authenticated.
os.chdir(r"\\mu m\my_share")
os.listdir(".")
# etc.
Alternatively, you could prepend the UNC path to each file you wish to
access, although this may be considerably slower:

to_process = [ 'input1.txt', 'input2.txt', 'job.ctl' ]
unc_path = r'\\mum\my_shar e'

for filename in to_process:
pathname = os.path.join(un c_path, filename)
processee = open(pathname)

...
Hope that helps. To the other respondees, answering in the unhelpful
manner that you did makes you no more than trolls. Has it ever crossed
your mind that in some parts of the world, the education necessary to
communicate in the accepted pythonic anal way, might not be readily
available?

You may argue that it is better to teach someone how to ask a question
correctly, but I would rather see it as being a poor example of your
community.

It is quite possible (gathering from the way he posted) that this
poster has never before talked on a Python user list. How do you think
he feels about his first experience with fellow Python programmers,
good or bad?

Nothing agitates me more on the Internet than people wasting each
other's time in this manner. True, the poster wasn't particularly
clear, but do you have a right to demand he posts in clear well
defined English?

The Internet is a global medium, and despite popular assumption,
English is not an Internet standard. I have as much right to post in
native Belfast slang as you have to post in well written English.
Please learn to be accepting of one another, it is so much more
helpful than to try to correct something that shouldn't be corrected.
The original poster was well meaning, was your reply?

If you didn't understand the question then don't reply. Others may
well do, and the poster will quickly work out whether or not he is
being clear by the number of replies he receives.

By doing the usual "person isn't being clear, lets make an example of
him" dance, you wasted not only your own time, but his, everyone who
reads your pointless thread, and some megabytes of Internet bandwidth
to boot.

Goodnight,
David.
Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1113
by: Josef Dalcolmo | last post by:
Hello, can anyone tell me how to find the list of computer names on a samba network, and the list of shared folders / devices on a samba networked computer? We have a GNU/Debian Server, and I am trying to do it first from a Win2000 machine (though ideally, the code should be platform-independent).
6
3271
by: tc | last post by:
Does anyone know of a module for python which simulates a samba server (windows fileshare). Instead of sharing a Phisical Device I'd like to share a database based filesystem which is spread over various numbers of drives and servers. Any hints? TC
2
421
by: Tyler Sample | last post by:
I've got a Samba share set up on a LINUX box. It's set up for user-level access. A Windows user is mapped to a UNIX user. When accessing through file explorer, a username/password box pops up, and I type the UNIX user name mapped to my current windows user and the SAMBA password. My problem is that I now want to access a Samba share in...
1
1795
by: jon wackley | last post by:
Hi All, Hope that this is the correct group to post this in, I'm quite stuck and have tried a great number of things including the MS knowledgebase, google, and other resources. I created a samba share and pointed an iis virtual directory to it. I access the directory by creating a new web project in VB.NET 2003. I create a simple aspx...
1
1802
by: Michael D. Ober | last post by:
I have an ASP.NET 2.0 base site that needs to access files on Snap Appliance's Guardian OS 4.2, which is running SAMBA 3.x which is a domain member on the network. How do I get our web-server, which is a DC, to retrieve files on the Snap server? Thanks, Mike Ober.
4
2115
by: Thyagu | last post by:
Hi, Is it possible to connect to SQL Server using trusted connection from unix? If yes, I'd like to know how. Regards, Thyagu.
0
2237
by: mvrk | last post by:
Hi, I got a Samba server configured on my Fedora 7 with LDAP authentication, when i try to login with a user that exists on the LDAP but doesn't exists on the system it just gives this msg: passdb/pdb_get_set.cdb_get_group_sid(211) pdb_get_group_sid: Failed to find Unix account for drocha Thing is that i got another PC with Centos...
1
2698
by: symbioid | last post by:
Hello, I'm working on a project, and VMware has problems with suspending the virtual machine. We are accessing the machine through samba. However, when I suspend the VM, it stops the Samba service. The solution we hit upon was to run a script that checks, say, once a minute to determine whether the machine was active or suspended. If...
1
1085
by: rakesh19 | last post by:
Hi, Can I embed images from a samba file server on the intranet in a web application? Rakesh
0
7532
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7461
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7730
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7491
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3509
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.