[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: : [Bug-tar] new feature suggestion
From: |
Martin Simmons |
Subject: |
Re: : [Bug-tar] new feature suggestion |
Date: |
Thu, 13 May 2004 10:23:53 +0100 (BST) |
>>>>> On Tue, 11 May 2004 21:56:39 +0100, Markus Kuhn <address@hidden> said:
Markus> Would it be possible to add to GNU tar a new option
Markus> --max-cwd-additions=1
Markus> that aborts the extraction of an archive with an error message if this
Markus> extraction would create more than 1 file or subdirectory in the
current
Markus> working directory (and may therefore create a mess that is difficult
to
Markus> clean up)?
Markus> Reason: Each tar archive I get, I first have to check manually,
whether
Markus> all files will already be unpacked under one single subdirectory in
the
Markus> archive, or whether I have to first create a new subdirectory in which
Markus> to unpack the archive, to ensure that I can easily remove the just
Markus> unpacked files again with rm -rf. The above option would allow me to
Markus> easily make sure that tar warns me whenever I call it outside a
separate
Markus> subdirectory created specifically for this extraction, if it is about
to
Markus> litter a thousand files in the current working directory.
Markus> Just an idea ...
I have that hassle too, so now I always make a fresh directory just in case.
If tar were to provide an option for this, I would want it to prevent a mess
in any directory, not just cwd. I'd be happy with a really restrictive option
--require-one-new-directory, which would make tar abort if:
a) it tries to create any files in cwd
b) it tries to create more than one subdirectory in cwd
c) it tries to create anything in any other existing subdirectory of cwd
The last case covers the situation where the archive consists of many files in
some commonly named directory like bin or src.
__Martin