Opened 5 years ago

Last modified 5 years ago

#13406 new Bugs

Boost 1.65.1 : Boost filesystem error codes for non existent files seems to be incorrect

Reported by: sudhanshu.gupta05@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.65.0 Severity: Problem
Keywords: Boost filesystem Cc:

Description

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?

Change History (1)

comment:1 by Kohei Takahashi, 5 years ago

Component: Nonefilesystem
Owner: set to Beman Dawes
Note: See TracTickets for help on using tickets.