Is there a way to convert a
zip archive to a
tar archive without extracting to a temporary directory first? (and without writing my own implementation of
This is now available as installable command from PyPI, see the end of this post.
I don't know of any "standard" utility that does so, but when I needed this functionality I wrote the following Python script to go from ZIP to Bzip2 compressed tar archives without extracting anything to disk first:
Just save it to
The Bzip2 compressed output is normally much smaller than the zip file because the latter doesn't use compression patterns over multiple files, but there is also less chance of recovering later file if something in the Bzip2 file is wrong.
If you don't want the output compressed, remove
If you have
to get a
One you have AVFS installed, then you can
AVFS will fill in any information for the file system that is missing from the zip, like file ownership, that tar will pick up.
Here’s a small snippet that converts a ZIP archive to a matching TAR.GZ archive OnTheFly.
Convert ZIP archive to TAR archive on the fly