[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wishing rmdir had a prompt
From: |
Sami Kerola |
Subject: |
Re: Wishing rmdir had a prompt |
Date: |
Mon, 2 Sep 2019 09:03:12 +0100 |
On Mon, 2 Sep 2019 at 05:50, Kaz Kylheku (Coreutils)
<address@hidden> wrote:
>
> On 2019-09-01 17:50, Leslie S Satenstein via GNU coreutils General
> Discussion wrote:
> > rmdir -i
>
> I don't see this in a fairly recent GNU Coreutils 8.28 installation.
> Must be very new?
I think '-i, --interactive' was more of a proposal what option is needed than
feedback how use command. Currently implemented options are below.
http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/rmdir.c#n56
> There is some justification for such a thing. Though it may seem that
> accidental
> deletion of empty directories is easy to restore by recreating them,
> that does not
> put the file system back in the pre-deleted state. The modification
> timestamps of
> parent directories are tweaked, and new empty directories come up with
> their own
> modification timestamps as well as different inode numbers, permissions,
> group and user
> ownerships and such. There is no substitute to not deleting something;
> what comes close
> is recovering it from a backup.
Unrelated to this request there's been times when I wish tar would have a
way to 'extract' only meta-data, such as permissions and ownership, but not
update file content. This would be handy when wanting to recover from
accidental sudo chown -R /usr/ run or something of that sort.
While on it being able to create tar file that contains only meta info would
make permission revert quite interesting, and hopefully lightweight. But
that is a totally new file format and miles away off topic what was requested
originally. So let me add my two pennies to that discussion.
> prompt me before removals
I am not a maintainer, but I don't see any problem adding --interactive long
only option. Getting a short option may clash with future posix requirement,
so I believe they are not handed out without really good reasons.
--
Sami Kerola
http://www.iki.fi/kerolasa/