<div>now it is working but i wonder it brings higher number of count as if it counts files in wholes computer can you check in my code and correct me </div>
<div>------------------------------------------------</div>
<div>import glob <br>import os<br> file_count=0<br>for files in glob.glob(r"<a href="file://192.168.0.45/loader/Files/file_log/v20090225">\\192.168.0.45\loader\Files\file_log\v20090225</a>*"):<br>      file_count += len(files)<br>
print 'Found', file_count, 'files in cwd'</div>
<div>--------------------------------------------------------------------------------------------------------------------------------</div>
<div> </div>
<div>the results are Found 435656 files in cwd  --which is impossible since files are around six thousands daily.</div>
<div>thanks in advance<br><br></div>
<div class="gmail_quote">On Thu, Feb 26, 2009 at 5:15 PM, Steve Holden <span dir="ltr"><<a href="mailto:steve@holdenweb.com">steve@holdenweb.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">lameck kassana wrote:<br>> ok my original question is how can count the files of ceratin pattern(eg<br>> *.txt) in remote directory .It seems use of glob.glob() for remote<br>> directory is not working .Example I want to count the files in following<br>
</div>> shared folder \\192.168.0.45\files <file://<a href="http://192.168.0.45/files" target="_blank">192.168.0.45/files</a>> how can<br>
<div class="Ih2E3d">> do it by using glob.glob()<br>><br></div>>>> glob.glob(r"\\houseboy\sholden\*.txt")<br>['\\\\houseboy\\sholden\\pgin1.txt',<br>'\\\\houseboy\\sholden\\POSTGRES.TXT',<br>
'\\\\houseboy\\sholden\\gatesquote.txt',<br>'\\\\houseboy\\sholden\\UbuntuWhatNow.txt',<br> '\\\\houseboy\\sholden\\patch001.txt']<br>>>> glob.glob(r"\\192.168.2.200\sholden\*.txt")<br>
['\\\\192.168.2.200\\sholden\\pgin1.txt',<br>'\\\\192.168.2.200\\sholden\\POSTGRES.TXT',<br>'\\\\192.168.2.200\\sholden\\gatesquote.txt',<br>'\\\\192.168.2.200\\sholden\\UbuntuWhatNow.txt',<br>
'\\\\192.168.2.200\\sholden\\patch001.txt']<br>>>><br><br>Working just fine for me.<br>
<div>
<div></div>
<div class="Wj3C7c"><br>regards<br> Steve<br>--<br>Steve Holden        +1 571 484 6266   +1 800 494 3119<br>Holden Web LLC              <a href="http://www.holdenweb.com/" target="_blank">http://www.holdenweb.com/</a><br>
<br></div></div></blockquote></div><br>