bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request: rm should implement option -p, --parents


From: Jim Meyering
Subject: Re: Feature request: rm should implement option -p, --parents
Date: Tue, 07 Jul 2009 13:56:59 +0200

Guido Flohr wrote:
> Pádraig Brady wrote:
>> But I'd be worried about using rm -p generally, as I might delete an
>> empty dir that didn't belong to me. Though if passed relative
>> paths that would be alleviated I suppose.
>
> It's trivial to protect a precious directory, by dropping a file in
> that directory.  Besides, not creating missing directory levels in an
> installer is poor practice, isn't it?
>
>> The package above should really be calling rmdir -p on relative dirs
>> created previously created with install -d or mkdir -p.
>
> Sure, that's debatable.  But I'm not talking about uninstall issues
> only.  Think of the example with the tarball for example.
>
> I think the assumption that an empty directory just wastes an inode is
> relatively safe.  And nobody would be forced to use that option.
>
>> I'll think some more about this,

First of all, this functionality does not belong in rm.
IMHO, rm has no business removing parent directories, with any option.
Not only is the semantic disparity too great, I wouldn't want to
add the code that's presently in rmdir.c to rm.

Even adding an option to rmdir is hard to justify,
since it's easy to script the desired behavior.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]