Proposal: removeDirectoryRecursive should not follow symlinks

Bardur Arantsson spam at scientician.net
Tue Jan 6 15:50:04 UTC 2015


On 2015-01-06 16:43, Mike Meyer wrote:
> On Tue, Jan 6, 2015 at 8:59 AM, Bardur Arantsson <spam at scientician.net>
> wrote:
>>
>> Because *nobody* wants to follow symlinks when doing "rm -rf". Even if
>> they think they do, they *really* don't. Any design which relies on it
>> is probably fundamentally broken. (If they're *really really* sure, they
>> can write their own.)
>>
> 
> Don't need to reread the arguments - I've been aware of them since CSRG
> introduced symlinks in 4BSD, and the utilities didn't know about them in
> the beta releases.
> 
> You pretty much never want to call it on a file tree you didn't build.  But
> if I built the file tree, then I know what's going on.

Indeed, but even in *that* case it's incredibly error-prone...

> Making me write my
> own is probably going to result in less robust code, or copying the code
> out of the library and tweaking it, neither of which is desirable.
> 

It's such a rare need and so dangerous that I'd argue that forcing a
copy + tweak is actually desirable in this case.

Regards,



More information about the Libraries mailing list