Hi Tim,

That does the trick!  Now my gui remains responsive during the long search
time. 

Thanks!

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Tim Golden
Sent: 30 December 2004 10:54
To: python-list@python.org
Subject: RE: Is there a better way of listing Windows shares other than us
ing "os.listdir"

[EMAIL PROTECTED]

| I'm currently using "os.listdir" to obtain the contents of 
| some slow Windows shares.  I think I've seen another way of 
| doing this using the win32 library but I can't find the 
| example anymore.

It may be FindFilesIterator, recently added to the win32file
module in pywin32. I don't know if it's any more efficient
than an os.listdir (which may use it under the covers, for
all I know) but it certainly works:

<code>
import win32file

for file_data in win32file.FindFilesIterator ("c:/temp/*"):
  ( attr, ctime, atime, wtime, 
    size_hi, size_lo, r0, r1, 
    longname, shortname
  ) = file_data
  print longname
</code>

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
-- 
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to