QFileInfo("<CD-ROM letter>").isReadable() can cause a "No disk" error on Windows. Bug or not?
At the moment, when I do QFileInfo("L:/").isReadable(), where L is my DVD-ROM drive letter, I get the error:
File Commander: FileCommander.exe - No Disk
There is no disk in the drive. Please insert a disk into drive L:.
Cancel Try Again Continue
what my app is doing is it enumerates disks on timer in a worker thread to watch for changes. So I get this message over and over again. Can this be solved? Is it a Qt bug?
Edited the question. It's QFileInfo::isReadable() that causes the trouble, not a constructor.
AFAIK, Qt's innocent. You'll get the same error message from e.g. explorer if you try to access an empty cd or floppy drive.
[quote author="SGaist" date="1412453207"]Hi,
You'll get the same error message from e.g. explorer if you try to access an empty cd or floppy drive.[/quote]
I believe it's a matter of carefully choosing which WinAPI functions to call first (ones that are safe from this error), checking their result and deciding whether or not it is safe to query for further drive / file / folder stats with those API functions that might result in this error.
It is true that many programs that are not written carefully enough will cause this error. If it wasn't for a very unlikely coincidence, I wouldn't know my program triggers the error either.