Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8240 > unrolled thread

Re: connect windows share

Started byTim Golden <mail@timgolden.me.uk>
First post2011-06-22 19:59 +0100
Last post2011-06-22 19:59 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: connect windows share Tim Golden <mail@timgolden.me.uk> - 2011-06-22 19:59 +0100

#8240 — Re: connect windows share

FromTim Golden <mail@timgolden.me.uk>
Date2011-06-22 19:59 +0100
SubjectRe: connect windows share
Message-ID<mailman.295.1308769209.1164.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web