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
