Boost C++ Libraries: Ticket #12574: is_directory sets boost::system::errc::no_such_process when path contains more directory components https://svn.boost.org/trac10/ticket/12574 <p> Assume there is a directory "/tmp", then is_directory("/tmp", error) returns true and sets error's value to <strong>success</strong>. </p> <p> When we query for subdirectory, like is_directory("/tmp/foo", error), then the function returns false and sets error's value to <strong>no_such_file_or_directory</strong>. It is OK. </p> <p> However, query like is_directory("/tmp/foo/bar") sets error's value to <strong>no_such_process</strong>. It is completely unexpected &amp; counterintuitive. It seems that this value is returned when the part of path after an existing directory contains directory separator(s) -- here "foo/bar". </p> <p> This happens on Windows, I haven't tested it on Linux. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12574 Trac 1.4.3 Beman Dawes Mon, 28 Nov 2016 13:24:26 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12574#comment:1 https://svn.boost.org/trac10/ticket/12574#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> A test case has been added to operations_test.cpp. It passes just fine, and a display of the error code values shows 2 and 3 on Windows: </p> <blockquote> <p> Windows <code>error_code</code> values <br /> -------------------------------- <br /> </p> <blockquote> <p> <code>2 ERROR_FILE_NOT_FOUND</code> <br /> <code>3 ERROR_PATH_NOT_FOUND</code> </p> </blockquote> </blockquote> <p> See <a class="ext-link" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx"><span class="icon">​</span>https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx</a> </p> <p> So it looks like you are confusing Windows specific <code>error_code</code> values with the portable <code>error_condition</code> values: </p> <blockquote> <p> Generic <code>error_condition</code> values <br /> ------------------------------------- <br /> </p> <blockquote> <p> <code>2 no_such_file_or_directory</code> <br /> <code>3 no_such_process</code> </p> </blockquote> </blockquote> <blockquote> <p> The ticket is being closed, but the tests are worth keeping so remain in operations_test.cpp. </p> </blockquote> Ticket Wojciech Muła <wojciech_mula@…> Tue, 29 Nov 2016 06:26:26 GMT <link>https://svn.boost.org/trac10/ticket/12574#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12574#comment:2</guid> <description> <p> Thank you very much, I wasn't aware of the differences between error code and condition. Sorry for bothering you. </p> </description> <category>Ticket</category> </item> </channel> </rss>