|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-11-18 12:35:12
At 12:35 AM 11/15/2003, Walter Landry wrote:
>
>I found that remove_all wants to follow symlinks when recursing. This
>causes it to fail if the target of the link does not exist. It also
>seems a little dangerous.
Thanks, Walter!
I think you're right. Like remove(), remove_all() should not follow
symbolic links when recursing.
> I have attached a patch to fix that.
The patch uses is_link(), and its specs need to be nailed down.
There are two questions that need to be answered:
[Help needed from POSIX programmers on the following.]
* Does S_ISLNK() return true only for symbolic links, and never for regular
reference-counted links? If so, that means is_link() never returns true
except for symbolic links, so I'd rather call it is_symbolic_link().
[Help needed from Win32 programmers on the following.]
* Can is_symbolic_link() just return false on Windows?
Windows does have some similar concepts - shortcuts and journals - but the
behavior seems different from a POSIX-style symbolic link. Particularly,
shortcuts by default seem to exhibit shallow rather than deep behavior, and
seem more an application (shell) artifact rather than a kernel feature. But
maybe I don't understand them - any pointers to an underlying API would be
appreciated. And I certainly don't understand journal points. Windows does
have reference counted hard links, very similar to POSIX links, but that
isn't the issue here.
Comments needed!
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk