bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] GNU tar/1.26 --remove-files with joker will remove/delete


From: Pavel Raiskup
Subject: Re: [Bug-tar] GNU tar/1.26 --remove-files with joker will remove/delete the created archive if one existed before
Date: Wed, 23 Jul 2014 13:05:41 +0200
User-agent: KMail/4.12.5 (Linux/3.15.4-200.fc20.x86_64; KDE/4.12.5; x86_64; ; )

On Tuesday 22 of July 2014 19:05:57 Klaus Gentzsch wrote:
> I found nothing mentioned about this is in GNU's version NEWs
> and nothing about it searching on keywords with google and duckduckgo...
> 
> I created some test-files to verify that:
>    The newly created archive file (length = 0), overwriting the previous
>    one, will be added to the archive itself, but at that time with no
>    content (length 0)
>    ....

Thanks for the report.  When you do _not_ use external compressor (gzip in
this case), you'll see that tar refuses to add the file into the archive
(and thus does not remove the file).  This file check is easily done by
comparing archive's device/inode number with dev/ino of currently archived
file.

When using external compressor, tar creates subprocess for it.  That
subprocess creates the archive file by creat() call (and execs the
compressor itself later on).  That way, the master-tar process does not
have a clue what the underlying archive is (it has only write side of pipe
at that moment to send data to subprocess).

What about rather creat() the file in parent process?

Pavel




reply via email to

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