|
Boost : |
Subject: Re: [boost] [filesystem] Should recursive_directory_iterator follow directory symlinks by default?
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-02-09 12:54:12
>>> Thus I'd like to add an option to either following directory symlinks
>>> or not. Which should the default be?
>>
>> *nix follows symlinks by default. One must use special APIs to recognize
>> and inspect symlinks. I should think consistency across platforms would
>> be good.
>
> That isn't really true. There isn't any POSIX function for recursive
> directory walking. It is simply a matter of whether lstat or stat is used
> to check whether directory entries are themselves directories. As one
> example, GNU find does not follow symlinks by default.
And also following symlinks requires special handling to prevent going round
and round in circles in the pathological cases.... which is not to say the
option of a symlink following API wouldn't be useful.
John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk