[Boost-bugs] [Boost C++ Libraries] #13484: exists doesn't clear no_such_file_or_directory type of error codes

Subject: [Boost-bugs] [Boost C++ Libraries] #13484: exists doesn't clear no_such_file_or_directory type of error codes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-03-17 01:47:44


#13484: exists doesn't clear no_such_file_or_directory type of error codes
----------------------------------------+-------------------------
 Reporter: Alex Weiss <alexweiss86@…> | Owner: Beman Dawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.66.0 | Severity: Problem
 Keywords: exists error_code |
----------------------------------------+-------------------------
 Windows 10, MSVC 19.13.26128.

 exists() fails when it successfully determines that a file doesn't exist
 (i.e. it sets the error code to ERROR_FILE_NOT_FOUND or throws in the
 throwing version). According to the reference and the tutorial example,
 that should not happen.

 Code example:
 {{{
         boost::filesystem::path p("c:\\filethatdoesntexist");
         boost::system::error_code ec;
         bool doesExist = boost::filesystem::exists(p, ec);
         if (ec == boost::system::errc::no_such_file_or_directory) {
                 std::cout << "shouldn't happen!\n";
         }
 }}}

 Note that for existing files, exists() works as expected.

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13484>
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 : 2018-03-17 01:51:56 UTC