Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #8240
| Date | 2011-06-22 19:59 +0100 |
|---|---|
| From | Tim Golden <mail@timgolden.me.uk> |
| Subject | Re: connect windows share |
| References | <BANLkTimy+qLhjV9Z5DeGLV1P2fsWR+RPfQ@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.295.1308769209.1164.python-list@python.org> (permalink) |
On 22/06/2011 19:38, Travis Altman wrote:
> I want to be able to connect to a windows share via python. My end goal
> is to be able to recursively search through windows shares. I want to
> do this in Linux as well. So given a share such as \\computer\test I
> would like to search through the test directory and any sub directories
> for any file names of interest. What's the best way of going about
> this? I know LDAP / AD creds may play an essential part in this as
> well. Thanks for your input.
Unless there's more to this than meets the eye, the answer's
really easy: just do it.
On Windows, you just do, eg:
import os
for dirpath, dirnames, filenames in os.walk (r"\\computer\test"):
# do stuff with stuff
Presumably on Linux you have to use whatever mechanism allows
you to address Windows shares in the equivalent way. Maybe
os.walk ("smb://computer/test") ?? I'm not really a Linux person,
I'm afraid
TJG
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: connect windows share Tim Golden <mail@timgolden.me.uk> - 2011-06-22 19:59 +0100
csiph-web