Boost C++ Libraries: Ticket #3185: absolute path error https://svn.boost.org/trac10/ticket/3185 <p> I have the following function that checks if a particular path is absolute or relative: </p> <p> bool isPathAbsolute(const std::string&amp; path) { </p> <blockquote> <p> return !boost::filesystem::path(path).root_directory().empty(); </p> </blockquote> <p> } </p> <p> Seems that it works fine for the following paths: </p> <blockquote> <p> "/" absolute "/root" absolute "<em>/" absolute "</em><em>" absolute </em></p> </blockquote> <p> However, for unknown reason function says that the path "<em>" is not absolute. See attached very simple code that presents this problem. </em></p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3185 Trac 1.4.3 tmmikolajczyk@… Wed, 17 Jun 2009 09:11:56 GMT attachment set https://svn.boost.org/trac10/ticket/3185 https://svn.boost.org/trac10/ticket/3185 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_absolute_path_test.tar.gz</span> </li> </ul> <p> the code printing the path's relativity checking result </p> Ticket Beman Dawes Thu, 18 Jun 2009 21:12:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3185#comment:1 https://svn.boost.org/trac10/ticket/3185#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">invalid</span> </li> </ul> <p> This isn't a bug - it is done deliberately to conform to POSIX. Here is the POSIX definition of Absolute Pathname: </p> <blockquote> <p> 3.2 Absolute Pathname </p> </blockquote> <blockquote> <p> A pathname beginning with a single or more than two slashes; see also Pathname. </p> </blockquote> <p> IIRC, Windows also treats two slashes differently, although it has been a while since I looked at how Windows handles multiple slashes. </p> <p> HTH, </p> <p> --Beman </p> <p> </p> Ticket