bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] --remove-files deletes files even if archive couldn't be


From: Bart Botta
Subject: Re: [Bug-tar] --remove-files deletes files even if archive couldn't be created, when used with compression
Date: Sun, 4 Oct 2009 04:53:33 -0500

On Sun, Oct 4, 2009 at 4:16 AM, Sergey Poznyakoff <address@hidden> wrote:
> Bart Botta <address@hidden> ha escrit:
>
>> $ ../src/tar cfv a --remove-files b
>> ../src/tar: a: Cannot open: Is a directory
>
> Argument to the -f option cannot be a directory. See
>

Right, I wasn't expecting it to actually create an archive, that was
just a convenient way to make it fail.

If you prefer, here is another version, which fails due to permissions:

$ mkdir a
$ chmod -xw a
$ mkdir b
$ touch b/c
$ tar cfv a/d.tar --remove-files b
tar: a/d.tar: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
$ ls b
c
$ tar cfvz a/d.tar --remove-files b
tar: a/d.tar: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
b/
b/c
tar: Child returned status 2
tar: Error exit delayed from previous errors
$ ls b
ls: cannot access b: No such file or directory
$ ls
a/


the point is that tar should actually 'exit now' when it says 'exiting
now' instead of proceeding to delete the files without putting them in
a usable archive.

--
3b




reply via email to

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