[Boost-bugs] [Boost C++ Libraries] #13406: Boost 1.65.1 : Boost filesystem error codes for non existent files seems to be incorrect

Subject: [Boost-bugs] [Boost C++ Libraries] #13406: Boost 1.65.1 : Boost filesystem error codes for non existent files seems to be incorrect
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-01-19 05:23:24


#13406: Boost 1.65.1 : Boost filesystem error codes for non existent files seems
to be incorrect
---------------------------------+---------------------
 Reporter: sudhanshu.gupta05@… | Owner: (none)
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
  Version: Boost 1.65.0 | Severity: Problem
 Keywords: Boost filesystem |
---------------------------------+---------------------
 Boost::filesystem::equivalent() when called on two non-existent files ,
 error codes generated seems to be incorrect.

 I am attaching simple test case which calls
 boost::filesystem::equivalent() on two non-existent files.

 #include "boost/filesystem/operations.hpp"
 #include <iostream>
 int main() {

     boost::filesystem::path path1("foo");
     boost::filesystem::path path2("bar");
     boost::system::error_code ec;
     if(!boost::filesystem::equivalent(path1,path2,ec))
     {
         std::cout<<"error code: " << ec << std::endl;;
         std::cout<<"error message: " << ec.message() << std::endl;;

     }
     return 0;
 }

 The output of the test case with boost 1.56 is

 **********************************************
 error code: system:2
 error message: No such file or directory
 **********************************************

 The output of the test case with boost 1.65 is

 ***********************************************
 error code: system:1
 error message: Operation not permitted
 ***********************************************

 Is this change an intentional one or a bug?

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13406>
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-01-19 05:49:57 UTC