Subject: [Boost-bugs] [Boost C++ Libraries] #2725: boost::filesystem::exists throws on Windows if the drive letter doesn't exist
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-02-04 15:10:59
#2725: boost::filesystem::exists throws on Windows if the drive letter doesn't
exist
--------------------------------------+-------------------------------------
Reporter: davidjward30_at_[hidden] | Owner: bemandawes
Type: Bugs | Status: new
Milestone: Boost 1.38.0 | Component: filesystem
Version: Boost 1.37.0 | Severity: Problem
Keywords: |
--------------------------------------+-------------------------------------
boost::filesystem::exists throws on Windows if the drive letter doesn't
exist.
This is rather unexpected. It's rather tedious to validate the drive
letter beforehand or to have to catch the exception.
I think it's reasonable to say that if the drive doesn't exist then the
file doesn't exist.
I noted that status_template checks a list of errors returned by
get_file_attributes:
if ((ec.value() == ERROR_FILE_NOT_FOUND)
|| (ec.value() == ERROR_PATH_NOT_FOUND)
|| (ec.value() == ERROR_INVALID_NAME) //
"tools/jam/src/:sys:stat.h", "//foo"
|| (ec.value() == ERROR_INVALID_PARAMETER) // ":sys:stat.h"
|| (ec.value() == ERROR_BAD_PATHNAME) // "//nosuch" on Win64
|| (ec.value() == ERROR_BAD_NETPATH
I would propose adding ERROR_INVALID_DRIVE to this list.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2725> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC