|
Boost : |
From: dizzy (dizzy_at_[hidden])
Date: 2008-05-30 05:52:29
Hello
If one creates a symlink like this "ln -s sym sym" (to itself symlink),
bfs::exists("sym") will throw because the documentation defines it to do so
(and I have nothing against it doing so, although in my programs because of
this I am forced to just use "lstat()" and I can't replace using "lstat()" to
check if something exists with bfs::exists).
However, I do think that bfs::remove("sym") throwing for the same reason
(because it calls upon bfs::exists()) is the wrong thing to do. The source
around bfs::remove() implementation even try to solve the issue of "dangling
symlinks" as they call it by having an exception in case bfs::exists returns
false and the target path points to a dangling symlink and still tries to
remove it. Unfortunetly, exists will throw in my example of a symlink (not
even dangling technically speaking :) ) even tho a remove on that kind of
symlink should work just fine (it does work in shell or just doing
std::remove()).
Is this a bug? If so, I should put it in the tracker?
Thanks!
-- Mihai RUSU Email: dizzy_at_[hidden] "Linux is obsolete" -- AST
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk