[Boost-bugs] [ boost-Bugs-1221465 ] remove_all problems on dangling symlinks

Bugs item #1221465, was opened at 2005-06-15 14:27 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1221465&group_id=7586 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: filesystem Group: None Status: Open Resolution: None Priority: 5 Submitted By: Christopher Dunn (cxdunn) Assigned to: Beman Dawes (beman_dawes) Summary: remove_all problems on dangling symlinks Initial Comment: remove_all() fails on dangling symlinks, and throws exception when they are in subdirs. <pre> #include <boost/filesystem/operations.hpp> #include <boost/filesystem/exception.hpp> #include <iostream> // for std::cout using namespace std; namespace fs = boost::filesystem; int main(){ system("rm -rf foo1 foo2 foo3"); system("ln -s nowhere foo1"); system("mkdir foo2; touch foo2/blank; echo apple > foo2/apple"); system("mkdir foo3; ln -s nowhere foo3/dangle"); try { fs::remove_all("foo1"); //fine, but no deletion fs::remove_all("foo2"); //fine fs::remove_all("foo3"); //error } catch (fs::filesystem_error const& exc){ cerr <<"ERROR:" <<exc.what() <<endl; } cerr << fs::exists("foo1") << "," << fs::symbolic_link_exists("foo1") <<endl; cerr << fs::exists("foo2") << "," << fs::symbolic_link_exists("foo3") <<endl; cerr << fs::exists("foo3") << "," << fs::symbolic_link_exists("foo2") <<endl; return 0; } </pre> Result: <pre> ERROR:boost::filesystem::remove: "foo3": Directory not empty 0,1 0,0 1,0 </pre> Also note that the post-condition is violated for foo1. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1221465&group_id=7586 ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Boost-bugs mailing list Boost-bugs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/boost-bugs

"SourceForge.net" <noreply@sourceforge.net> wrote in message news:E1DidXS-0007oi-Py@sc8-sf-web1.sourceforge.net...
Bugs item #1221465, was opened at 2005-06-15 14:27 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1221465&group_id=7586
Result: <pre> ERROR:boost::filesystem::remove: "foo3": Directory not empty 0,1 0,0 1,0 </pre>
Also note that the post-condition is violated for foo1.
I've asked on the bug tracker for the compiler and O/S versions involved. My guess is that this is the Metrowerks 9.5 std::remove() bug on Mac OS X, rather than a bug in Boost code. In the meantime, I'm adding test cases to operations_test to detect the OP's reported error. Now that the Dirxion Mac OS X tests are cycling again, it looks like the filesystem operations_test is passing for Metrowerks 9.5. So the workaround was successful, and that will close this bug report if in fact it happened on Metrowerks/Mac OS X. --Beman

"Beman Dawes" <bdawes@acm.org> wrote in message news:d8sndv$497$1@sea.gmane.org...
"SourceForge.net" <noreply@sourceforge.net> wrote in message news:E1DidXS-0007oi-Py@sc8-sf-web1.sourceforge.net...
Bugs item #1221465, was opened at 2005-06-15 14:27 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1221465&group_id=7586
Result: <pre> ERROR:boost::filesystem::remove: "foo3": Directory not empty 0,1 0,0 1,0 </pre>
Also note that the post-condition is violated for foo1.
I've asked on the bug tracker for the compiler and O/S versions involved. My guess is that this is the Metrowerks 9.5 std::remove() bug on Mac OS X, rather than a bug in Boost code.
In the meantime, I'm adding test cases to operations_test to detect the OP's reported error.
These test cases have been added to CVS. They pass on Linux with GCC. (They don't apply to Windows, since it doesn't support symbolic links.) I'll watch as the regression tests cycle to make sure the new test cases don't break on any other platforms. --Beman

"SourceForge.net" <noreply@sourceforge.net> wrote in message news:E1DidXS-0007oi-Py@sc8-sf-web1.sourceforge.net...
Bugs item #1221465, was opened at 2005-06-15 14:27 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1221465&group_id=7586
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: filesystem Group: None Status: Open Resolution: None Priority: 5 Submitted By: Christopher Dunn (cxdunn) Assigned to: Beman Dawes (beman_dawes) Summary: remove_all problems on dangling symlinks
Initial Comment: remove_all() fails on dangling symlinks, and throws exception when they are in subdirs.
The OP was using 1.31. The problem was fixed for 1.32 and later. The bug report has been closed. --Beman
participants (2)
-
Beman Dawes
-
SourceForge.net