in reply to Using Tar
. I only want the latest copy of the file in the tarball.
I think you have to delete and then add. But I also dont think that Tar is the right candidate for this job. Im guessing here of course, but perhaps gnu zip is better as it offers this type of operation directly. It doesnt compress as well as tar/zip but its much more suitable for your needs. Also, iirc Tar doesnt like Win32 paths, so you need to chdir into the directory of the file first wheras zip does the right thing.
The second part of my question is how do I supress the output of system calls to tar?
But dont do that. Maybesystem("tar --delete --file foo.tar foo.bar >NULL: 2>&1");
is better? Then you can least extract the error if you need to.my $result=`tar --delete --file foo.tar foo.bar 2>&1`;
I also think that if your tarballs aren't large then Archive::Tar might be suitable.
|
|---|