file system iteration

rick ath-admin at vt.edu
Mon Oct 9 10:28:43 EDT 2006


Tim Golden wrote:
> [Rick]
> | Searching for a file by name. Scanning for viruses. Etc. 
> | There are lots 
> | of legitimate reason to walk all paths from a central 
> | starting point, no???
> 
> Well, to get you started, I think this is the kind
> of thing you'll want. Uses ctypes, which is built-in
> to Python 2.5 so presumably legit.
> 
> <code>
> import ctypes
> import string
> 
> GetDriveType = ctypes.windll.kernel32.GetDriveTypeA
> 
> for letter in string.uppercase:
>   print letter, "=>", GetDriveType ("%s:" % letter)
> 
> </code>

Thanks, I'll give this a try. I appreciate everyone's input.



More information about the Python-list mailing list