I just got surprised by a change in tar behavior ...
With a recent version (1.23, 1.26) of tar :
% touch foo
% tar -cvf foo.tar foo
foo
% tar -kxvf foo.tar
foo
% tar --warning=all -kxvf foo.tar
foo
% tar --warning=all --keep-old-files -xvvvf foo.tar
-rw-r--r-- dougmc/local 0 2011-11-16 22:43 foo
{ --warning=all is the default according to the docs, but I just made sure }
With an old version (1.20) of tar :
% touch foo
% tar -cvf foo.tar foo
% tar -cvf foo.tar foo
foo
% tar -kxvf foo.tar
foo
tar: foo: Cannot open: File exists
tar: Error exit delayed from previous errors
Looking at the Changelog --
2009-05-14 Sergey Poznyakoff <[email protected]>
Do not issue errors on existing files when given the -k option
... so this is intentional, and it makes sense -- an error probably
isn't appropriate. But no message at all?
I would propose that if a file is not put down due to it already
existing and the -k / --keep-old-files flag being given, that a
warning should be thrown. (Really, it's more of an informational
message, but the logging mechanism isn't that fancy.)
--
Doug McLaren, [email protected]