Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Closed
Description
We don't currently have a way to get all the root directories on Windows, sinceos.listdir('/')
doesn't contain everything.
I propose a very simple API:
>>> os.listdrives()["C:\\", "D:\\", ...]>>> os.listdrives(uuids=True)["\\?\Volume{4c1b02c1-d990-11dc-99ae-806e6f6e6963}\", ...]
Basically,listdrives(uuids=True)
would return everything found byFindNextVolume
, whilelistdrives()
would applyGetVolumePathNamesForVolumeName
to each GUID and return all of those. (This may return the same volume multiple times under different names, which is fine -os.stat
can be used to see if they're the samest_dev
.)
There's an endless amount of variations we could also apply here, but the most important functionality in my mind is to expose the OS API. App developers at least then have a starting point to do whatever they may need.