![]() 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 In conjunction with a secondary archiver program such as tar(1). 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. 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |