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

lameck kassana lkassana at gmail.com
Thu Feb 26 07:38:01 EST 2009


i am trying to write script which will count files for remote directory
which having certain pattern.

i tried with my code and have a look at this code.
-----------------------------------------------------------------------------------

import glob
import os
import time
from datetime import date
today=date.today()
dir_count, file_count=0, 0

for files in glob.glob('*\\192.168.0.45\files\*.txt'*):
     file_count += len(files)
print '----the count of ',today, '-------'
print 'Found', dir_count, 'sub-directories in cwd'
print 'Found', file_count, 'files in cwd'
print 'Found', dir_count + file_count, 'files & sub-directories in cwd'
filename="reconciliation.txt"
file_string= str(file_count)+','+ str(today)+'\n'
File=open(filename,"a")
File.writelines( file_string)
File.close()
--------------------------------------------------------------------------------------------------------
the problem the glob.glob() does not work in remotely directory especially
in window environment i don't know why??

i also try os.walk() for remote directory it failed i am wondering why . Do
i have to import a new module in import besides import  glob,os
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090226/991f3abb/attachment.html>


More information about the Python-list mailing list