Opened 13 years ago
Closed 12 years ago
#3867 closed Bugs (fixed)
[filesystem] filesystem::exists() improperly throws on windows when path specifies an empty CD/DVD drive
Reported by: | David Grigsby | Owned by: | Beman Dawes |
---|---|---|---|
Milestone: | Boost 1.42.0 | Component: | filesystem |
Version: | Boost 1.41.0 | Severity: | Problem |
Keywords: | Cc: |
Description
If you call filesystem::exists() with a path pointing to an empty cd/dvd drive on windows, a filesystem exception will be thrown due to status_template returning fs::status_unknown.
Boost 1.41.0 returns fs::file_not_found for "USB card reader with no card inserted" (operations.cpp, line 195).
The comment is "these are not considered errors; the status is considered not found".
I believe an empty cd/dvd drive should be treated analogously to an empty USB card reader, that is, no exception should be thrown.
The exception is occurring because the error code returned by windows (ERROR_NOT_READY) is not in the list of codes that are specifically checked.
I am attaching a patch.
Thanks!
Attachments (1)
Change History (2)
by , 13 years ago
Attachment: | patchfile.patch added |
---|
comment:1 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
patch top operations.cpp with proposed fix