Boost C++ Libraries: Ticket #4065: Boost Filesystem lexicographic path comparison inconsistent https://svn.boost.org/trac10/ticket/4065 <p> I am using boost svn number 60558. Briefly, paths "/foo/" and "/foo/." are not &lt;, &gt;, or ==: </p> <p> #include &lt;iostream&gt; </p> <p> #include &lt;boost/filesystem.hpp&gt; </p> <p> int main(int argc, char *argv[]){ </p> <blockquote> <p> boost::filesystem::path p("/foo/"); boost::filesystem::path q("/foo/."); if (p&lt;q) </p> <blockquote> <p> std::cerr &lt;&lt; p &lt;&lt; " &lt; " &lt;&lt; q &lt;&lt; std::endl; </p> </blockquote> <p> else if (p==q) </p> <blockquote> <p> std::cerr &lt;&lt; p &lt;&lt; " == " &lt;&lt; q &lt;&lt; std::endl; </p> </blockquote> <p> else if (p&gt;q) </p> <blockquote> <p> std::cerr &lt;&lt; p &lt;&lt; " &gt; " &lt;&lt; q &lt;&lt; std::endl; </p> </blockquote> <p> else </p> <blockquote> <p> std::cerr &lt;&lt; p &lt;&lt; " ? " &lt;&lt; q &lt;&lt; std::endl; </p> </blockquote> </blockquote> <p> } </p> <p> gives the following output: </p> <p> /foo/ ? /foo/. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4065 Trac 1.4.3 Beman Dawes Sat, 31 Mar 2012 15:53:27 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4065#comment:1 https://svn.boost.org/trac10/ticket/4065#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77669" title="Fix #4065, Boost Filesystem lexicographic path comparison ...">[77669]</a>) Fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4065" title="#4065: Bugs: Boost Filesystem lexicographic path comparison inconsistent (closed: fixed)">#4065</a>, 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. </p> Ticket