[MERGE] Use win32file.FindFiles instead of os.lstat when available

John Arbash Meinel john at arbash-meinel.com
Fri Jun 27 03:34:05 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Hammond wrote:
|> The date object in pywin32 sucks.  I'd be more interested in having
|> pywin32 work more closely with the datetime object than trying to
|> breath more life into that object.
|
| Actually, that came out stronger than I meant it - I'm more interested
in making the pywin32 date object work more seamlessly with datetime
objects than in trying to make the object itself "saner".  Adding a
"timetuple" method is worth investigating (pywin32 already supporting
being passed an object with such a method, allowing datetime objects to
be passed to pywin32 - but this is when pywin32 is returning them)
|
| Mark
|
|

So

1) I don't really care about the specific date for the file. All I need
is an 'mtime' to compare against 'time.time()'. Specifically, I need
that to be able to tell if a file is "old" enough to be safely cached,
such that the fs granularity will show if it is modified. (fat32 having
a granularity of ~2s.)

2) This is performance critical "touch every file on the filesystem"
code, so I need it to perform well. I'm trying to get away from the
current "nt.lstat()" which starts a FindFile() for every node. I'll
probably just wrap FindFirstFile, FindNextFile, and FindClose in my own
wrapper. And do the same offset work I found in the python library.

3) Thanks for mentioning FindFilesIterator, though I was already using
it. I just used FindFilesW here because it was simpler for an example.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhkUZ0ACgkQJdeBCYSNAAO/fQCfe73LrSf9CTUq+XujEarntVhE
g8QAoJfGD4Qg08fSarepdxCVuzRhWs+U
=yKJk
-----END PGP SIGNATURE-----



More information about the bazaar mailing list