I suspect that Mark found it unnecessary since other archiving methods worked easily with TAR. He writes in the funzip man page, this functionality should be incorporated into unzip itself (future release). It is worth noting that funzip is written by Info-ZIP original author Mark Adler. This will work for you if you have a tar.ZIP. This goes well with the idea that most linux archives are usually TAR'ed and then ZIPped in some way (gzip, bzip, et al). Theįollowing section includes an example illustrating this usage in the So if you know how to use gzip, you’re good to go without the need to install anything. There are other compression tools available, but no matter which Linux computer you find yourself needing to work on, you’ll find gzip on it. In conjunction with a secondary archiver program such as tar(1). The gzip data compression tool was written in the early 1990s, and it’s still found in every Linux distribution. Given the limitation on single-member extraction, funzip is most useful If there is a file argument, then input is read from the When stdin comes from a tty device, funzip assumes that this cannot beĪ stream of (binary) compressed data and shows a short help text, ![]() Input, and it extracts the first member from the archive to stdout. However, all is not lost.įunzip without a file argument acts as a filter that is, it assumes that a ZIP archive (or a gzip'd file) is being piped into standard But the standard unzip does not do that (though, it does support extraction to a pipe). This is usually easily supported by gzip and tar kind of tools with a - argument. What you want to do is, make unzip take a ZIPped file on its standard input rather than as an argument. ![]() bsdtar and bsdcpio) can and will do so when reading through a pipe, meaning that the following is possible: wget -qO- | bsdtar -xvf- As seen in the previous example, the unzip command retains both the archive and the decompressed file will be in the same directory. In addition, individual entries also include this information in a local file header, for redundancy purposes.Īlthough not every ZIP decompressor will use local file headers when the index is unavailable, the tar and cpio front ends to libarchive (a.k.a. The directory at the end of the archive is not the only location where file meta information is stored in the archive. As such it appears unsurprising that most ZIP decompressors simply fail when the archive is supplied through a pipe. ![]() This would appear to pose a problem when attempting to read a ZIP archive through a pipe, in that the index is not accessed until the very end and so individual members cannot be correctly extracted until after the file has been entirely read and is no longer available. This directory says where, within the archive each file is located and thus allows for quick, random access, without reading the entire archive. The ZIP file format includes a directory (index) at the end of the archive. This is a repost of my answer to a similar question:
0 Comments
Leave a Reply. |