Determine if windows drive letter is hard drive or optical from python?

mh sesquile at gmail.com
Fri May 27 14:46:26 EDT 2005


Hi Folks-

I'm trying to do a simple emulation of unix "locate" functionality in
python for windows.

Problem is I don't want to crawl/index optical drives.  Do any of the
windows people out there know how I can determine:

1. How many drives are on the system?  (I could just iterate over the
alphabet os.path.exists("%s:\\"%letter) ... is there a "windows" way of
doing it?)

2. More importantly for those drives that exist, how do I determine if
it is actually a harddrive?

thanks

matt




More information about the Python-list mailing list