problem with glob in remote directory or os.walk in remote directory in windos

Steve Holden steve at holdenweb.com
Thu Feb 26 09:15:23 EST 2009


lameck kassana wrote:
> ok my original question is how can count the files of ceratin pattern(eg
> *.txt) in remote directory .It seems use of glob.glob() for remote
> directory is not working .Example I want to count the files in following
> shared folder \\192.168.0.45\files <file://192.168.0.45/files> how can
> do it by using glob.glob() 
> 
>>> glob.glob(r"\\houseboy\sholden\*.txt")
['\\\\houseboy\\sholden\\pgin1.txt',
'\\\\houseboy\\sholden\\POSTGRES.TXT',
'\\\\houseboy\\sholden\\gatesquote.txt',
'\\\\houseboy\\sholden\\UbuntuWhatNow.txt',
 '\\\\houseboy\\sholden\\patch001.txt']
>>> glob.glob(r"\\192.168.2.200\sholden\*.txt")
['\\\\192.168.2.200\\sholden\\pgin1.txt',
'\\\\192.168.2.200\\sholden\\POSTGRES.TXT',
'\\\\192.168.2.200\\sholden\\gatesquote.txt',
'\\\\192.168.2.200\\sholden\\UbuntuWhatNow.txt',
'\\\\192.168.2.200\\sholden\\patch001.txt']
>>>

Working just fine for me.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list