Ticket #4065 (closed Bugs: fixed)

Opened 7 years ago

Last modified 5 years ago

Boost Filesystem lexicographic path comparison inconsistent

Reported by: dbetz@… Owned by: bemandawes
Milestone: Boost 1.43.0 Component: filesystem
Version: Boost Development Trunk Severity: Showstopper
Keywords: filesystem, lexicographic_compare Cc:


I am using boost svn number 60558. Briefly, paths "/foo/" and "/foo/." are not <, >, or ==:

#include <iostream>

#include <boost/filesystem.hpp>

int main(int argc, char *argv[]){

boost::filesystem::path p("/foo/"); boost::filesystem::path q("/foo/."); if (p<q)

std::cerr << p << " < " << q << std::endl;

else if (p==q)

std::cerr << p << " == " << q << std::endl;

else if (p>q)

std::cerr << p << " > " << q << std::endl;


std::cerr << p << " ? " << q << std::endl;


gives the following output:

/foo/ ? /foo/.


Change History

comment:1 Changed 5 years ago by bemandawes

  • Status changed from new to closed
  • Resolution set to fixed

(In [77669]) Fix #4065, Boost Filesystem lexicographic path comparison inconsistent. The fix included adding path::compare functions, and cleanup and refactoring of the path relational operators code. Some of the code fixed is used by other functions, so some unrelated bugs may also have been fixed.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.