[Tutor] CD ROM Drive
neven.gorsic at gmail.com
Wed Jul 16 13:31:16 CEST 2008
I am using Python 2.5.2 on WinXP Pro and I want to detect all disk drives.
I have C:, D: and E: hard disks and F: DVD ROM.
When I try to use os.access method with writing checking I get True
testing DVD ROM Drive with DVD media inside (which is not writable).
1. Why? DVD disk is not writable!
>>> import os
>>> print os.access('F:\\',os.W_OK)
2. When I remove DVD Disk from the drive I get unswer False.
That is OK. But when I run program with that single command
from Windows Explorer I get Windows alert Window:
"No disk! Please insert a disk into drive F:"
That alert stops program and I must respond with: Cancel, Try again or Continue.
The alert remains even with try, except(WindowsError)
Interesting point is that that alert doesn't pop up before I open DVD
for the first time.
After first inserting and ejecting DVD media alert is here!
It seems that information that is DVD no longer avilable is not
How can I avoid that?
3. Are there some other way to get list of all disk drives and DVD ROM drives?
I hoped that I can do that with modules that comes with standard
Thank you very much for your consideration
-------------- next part --------------
A non-text attachment was scrubbed...
Name: No Disk.jpg
Size: 9858 bytes
Desc: not available
More information about the Tutor