⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unzip.1

📁 压缩算法的源代码
💻 1
📖 第 1 页 / 共 2 页
字号:
The first hyphen is the normalswitch character, and the second is a minus sign, acting on the q option.Thus the effect here is to cancel one quantum of quietness.  To cancelboth quiet flags, two (or more) minuses may be used:.LP.PD 0.Y "unzip \-t\-\-q zipfile".Y "unzip \-\-\-qt zipfile".PD.LP(the two are equivalent).  This may seem awkwardor confusing, but it is reasonably intuitive:  just ignore the firsthyphen and go from there.  It is also consistent with the behavior ofUnix \fInice\fP(1)..LPAs suggested by the examples above, the default variable names are UNZIP_OPTS for VMS (where the symbol used to install \fIunzip\fP as a foreign commandwould otherwise be confused with the environment variable), and UNZIPfor all other operating systems.  For compatibility with \fIzip\fP(1L),UNZIPOPT is also accepted (don't ask).  If both UNZIP and UNZIPOPTare defined, however, UNZIP takes precedence.  \fIunzip\fP's diagnosticoption (\fB\-v\fP with no zipfile name) can be used to check the valuesof all four possible \fIunzip\fP and \fIzipinfo\fP environment variables..LPThe timezone variable (TZ) should be set according to the local timezonein order for the \fB\-f\fP and \fB\-u\fP to operate correctly.  See thedescription of \fB\-f\fP above for details.  This variable may also benecessary in order for timestamps on extracted files to be set correctly..PD.\" =========================================================================.SH DECRYPTIONEncrypted archives are fully supported by Info-ZIP software, but due toUnited States export restrictions, the encryption and decryption sourcesare not packaged with the regular \fIunzip\fP and \fIzip\fP distributions.Since the crypt sources were written by Europeans, however, they are freely available at sites throughout the world; see the file ``Where'' in any Info-ZIP source or binary distribution for locations both inside andoutside the US..LPBecause of the separate distribution, not all compiled versions of \fIunzip\fPsupport decryption.  To check a version for crypt support, either attempt totest or extract an encrypted archive, or else check \fIunzip\fP's diagnosticscreen (see the \fB\-v\fP option above) for ``\fC[decryption]\fR'' as one ofthe special compilation options..LPThere are no runtime options for decryption; if a zipfile member is encrypted,\fIunzip\fP will prompt for the password without echoing what is typed.\fIunzip\fP continues to use the same password as long as it appears to bevalid; it does this by testing a 12-byte header.  The correct password willalways check out against the header, but there is a 1-in-256 chance that anincorrect password will as well.  (This is a security feature of the PKWAREzipfile format; it helps prevent brute-force attacks which might otherwisegain a large speed advantage by testing only the header.)  In the case thatan incorrect password is given but it passes the header test anyway, either an incorrect CRC will be generated for the extracted data or else \fIunzip\fP will fail during the extraction because the ``decrypted'' bytes do not constitute a valid compressed data stream..LPIf the first password fails the header check on some file, \fIunzip\fP willprompt for another password, and so on until all files are extracted.  Ifa password is not known, entering a null password (that is, just a carriagereturn) is taken as a signal to skip all further prompting.  Only unencryptedfiles in the archive(s) will thereafter be extracted.  (Actually that's notquite true; older versions of \fIzip\fP(1L) and \fIzipcloak\fP(1L) allowednull passwords, so \fIunzip\fP checks each encrypted file to see if the nullpassword works.  This may result in ``false positives'' and extractionerrors, as noted above.).LPNote that there is presently no way to avoid interactive decryption.  Thisis another security feature:  plaintext passwords given on the command line or stored in files constitute a risk because they may be seen by others.Future releases may (under protest, with great disapproval) support such shenanigans..PD.\" =========================================================================.SH EXAMPLESTo use \fIunzip\fP to extract all members of the archive \fIletters.zip\fPinto the current directory and subdirectories below it, creating anysubdirectories as necessary:.LP.Y "unzip letters".LPTo extract all members of \fIletters.zip\fP into the current directory only:.LP.Y "unzip -j letters".LPTo test \fIletters.zip\fP, printing only a summary message indicatingwhether the archive is OK or not:.LP.Y "unzip -tq letters".LPTo test \fIall\fP zipfiles in the current directory, printing only thesummaries:.LP.Y "unzip -tq \e*.zip".LP(The backslash before the asterisk is only required if the shell expandswildcards, as in Unix; double quotes could have been used instead, as inthe source examples below.)\ \ To extract to standard output all members of \fIletters.zip\fP whose names end in \fI.tex\fP, auto-converting to the local end-of-line convention and piping the output into \fImore\fP(1):.LP.Y "unzip \-ca letters \e*.tex | more".LPTo extract the binary file \fIpaper1.dvi\fP to standard output and pipe it to a printing program:.LP.Y "unzip \-p articles paper1.dvi | dvips".LPTo extract all FORTRAN and C source files--*.f, *.c, *.h, and Makefile--intothe /tmp directory:.LP.Y "unzip source.zip ""*.[fch]"" Makefile -d /tmp".LP(the double quotes are necessary only in Unix and only if globbing is turnedon).  To extract all FORTRAN and C source files, regardless of case (e.g.,both *.c and *.C, and any makefile, Makefile, MAKEFILE or similar):.LP.Y "unzip \-C source.zip ""*.[fch]"" makefile -d /tmp".LPTo extract any such files but convert any uppercase MS-DOS or VMS names tolowercase and convert the line-endings of all of the files to the localstandard (without respect to any files which might be marked ``binary''):.LP.Y "unzip \-aaCL source.zip ""*.[fch]"" makefile -d /tmp".LPTo extract only newer versions of the files already in the current directory, without querying (NOTE:  be careful of unzipping in one timezone a zipfile created in another--ZIP archives to date contain no timezone information, and a ``newer'' file from an eastern timezone may, in fact, beolder):.LP.Y "unzip \-fo sources".LPTo extract newer versions of the files already in the current directory andto create any files not already there (same caveat as previous example):.LP.Y "unzip \-uo sources".LPTo display a diagnostic screen showing which \fIunzip\fP and \fIzipinfo\fPoptions are stored in environment variables, whether decryption support was compiled in, the compiler with which \fIunzip\fP was compiled, etc.:.LP.Y "unzip \-v".LPIn the last five examples, assume that UNZIP or UNZIP_OPTS is set to -q.To do a singly quiet listing:.LP.Y "unzip \-l file.zip".LPTo do a doubly quiet listing:.LP.Y "unzip \-ql file.zip".LP(Note that the ``\fC.zip\fR'' is generally not necessary.)  To do a standardlisting:.LP.PD 0.Y "unzip \-\-ql file.zip".LPor.Y "unzip \-l\-q file.zip".LPor.Y "unzip \-l\-\-q file.zip\t\fR(extra minuses don't hurt)".PD.\" =========================================================================.SH TIPSThe current maintainer, being a lazy sort, finds it very useful to definea pair of aliases:  \fCtt\fP for ``\fCunzip \-tq\fR'' and \fCii\fP for ``\fCunzip \-Z\fR'' (or ``\fCzipinfo\fR'').  One may then simply type ``\fCtt zipfile\fR'' to test an archive, something which is worth making a habit of doing.  With luck \fIunzip\fP will report ``\fCNo errors detected in zipfile.zip\fP,'' after which one may breathe a sigh of relief..LPThe maintainer also finds it useful to set the UNZIP environment variableto ``\fC\-aL\fR'' and is tempted to add ``\fC\-C\fR'' as well.  His ZIPINFO variable is set to ``\fC\-z\fR''..PD.\" =========================================================================.SH DIAGNOSTICSThe exit status (or error level) approximates the exit codes defined by PKWARE and takes on the following values, except under VMS:.RS.IP 0normal; no errors or warnings detected..IP 1one or more warning errors were encountered, but processing completedsuccessfully anyway.  This includes zipfiles where one or more fileswas skipped due to unsupported compression method or encryption with anunknown password..IP 2a generic error in the zipfile format was detected.  Processing may havecompleted successfully anyway; some broken zipfiles created by otherarchivers have simple work-arounds..IP 3a severe error in the zipfile format was detected.  Processing probablyfailed immediately..IP 4-8\fIunzip\fP was unable to allocate memory for one or more buffers..IP 9the specified zipfiles were not found..IP 10invalid options were specified on the command line..IP 11no matching files were found..IP 50the disk is (or was) full during extraction..IP 51the end of the ZIP archive was encountered prematurely..RE.LPVMS interprets standard Unix (or PC) return values as other, scarier-lookingthings, so by default \fIunzip\fP always returns 0 (which reportedly getsconverted into a VMS status of 1--i.e., success).  There are two compilationoptions available to modify or expand upon this behavior:  definingRETURN_CODES results in a human-readable explanation of what the realerror status was (but still with a faked ``success'' exit value), whiledefining RETURN_SEVERITY causes \fIunzip\fP to exit with a ``real'' VMSstatus.  The latter behavior will become the default in futureversions unless it is found to conflict with officially defined VMS codes.The current mapping is as follows:   1 (success) for normal exit, 0x7fff0001for warning errors, and (0x7fff000? + 16*normal_unzip_exit_status) for allother errors, where the `?' is 2 (error) for \fIunzip\fP values 2 and 9-11,and 4 (fatal error) for the remaining ones (3-8, 50, 51).  Check the ``\fCunzip \-v\fR'' output to see whether RETURN_SEVERITY was defined at compilation time..PD.\" =========================================================================.SH BUGSWhen attempting to extract a corrupted archive, \fIunzip\fP may go intoan infinite loop and, if not stopped quickly enough, fill all available diskspace.  Compiling with CHECK_EOF should fix this problem for all zipfiles,but the option was introduced too late in the testing process to be madethe default behavior.  Future versions will be robust enough to failgracefully on damaged archives.  Check the ``\fCunzip \-v\fR'' output tosee whether CHECK_EOF was defined during compilation..LP[MS-DOS] When extracting or testing files from an archive on a defectivefloppy diskette, if the ``Fail'' option is chosen from DOS's ``Abort, Retry,Fail?'' message, \fIunzip\fP may hang the system, requiring a reboot.  Instead,press control-C (or control-Break) to terminate \fIunzip\fP..LPUnder DEC Ultrix, \fIunzip\fP will sometimes fail on long zipfiles (bad CRC,not always reproducible).  This is apparently due either to a hardware bug(cache memory) or an operating system bug (improper handling of page faults?)..LPDates and times of stored directories are not restored..LP[OS/2] Extended attributes for existing directories are never updated.  Thisis a limitation of the operating system; \fIunzip\fP has no way to determinewhether the stored attributes are newer or older than the existing ones..LP[VMS] When extracting to another directory, only the \fI[.foo]\fP syntax isaccepted for the \fB\-d\fP option; the simple Unix \fIfoo\fP syntax issilently ignored (as is the less common VMS \fIfoo.dir\fP syntax)..LP[VMS] When the file being extracted already exists, \fIunzip\fP's query onlyallows skipping, overwriting or renaming; there should additionally be a choice for creating a new version of the file.  In fact, the ``overwrite''choice does create a new version; the old version is not overwritten ordeleted..PD.\" =========================================================================.SH SEE ALSO\fIfunzip\fP(1L), \fIzip\fP(1L), \fIzipcloak\fP(1L), \fIzipgrep\fP(1L),\fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L).PD.\" =========================================================================.SH AUTHORSThe primary Info-ZIP authors (current zip-bugs workgroup) are:  Jean-loupGailly (Zip); Greg R. Roelofs (UnZip); Mark Adler (decompression, fUnZip); Kai Uwe Rommel (OS/2); Igor Mandrichenko and Hunter Goatley (VMS); John Bushand Paul Kienitz (Amiga); Antoine Verheijen (Macintosh); Chris Herborth (Atari); Henry Gessau (NT); Karl Davis, Sergio Monesi and Evan Shattock (Acorn Archimedes); and Robert Heath (Windows).  The author of the original unzip code upon which Info-ZIP's is based was Samuel H. Smith; Carl Mascott did the first Unix port; and David P. Kirschbaum organized and led Info-ZIPin its early days.  The full list of contributors to UnZip has grown quitelarge; please refer to the CONTRIBS file in the UnZip source distributionfor a relatively complete version..PD.\" =========================================================================.SH VERSIONS.ta \w'vx.xxnn'u +\w'fall 1989'u+3n.PD 0.IP "v1.2\t15 Mar 89" \w'\t\t'uSamuel H. Smith.IP "v2.0\t\ 9 Sep 89"Samuel H. Smith.IP "v2.x\tfall 1989"many Usenet contributors.IP "v3.0\t\ 1 May 90"Info-ZIP (DPK, consolidator).IP "v3.1\t15 Aug 90"Info-ZIP (DPK, consolidator).IP "v4.0\t\ 1 Dec 90"Info-ZIP (GRR, maintainer).IP "v4.1\t12 May 91"Info-ZIP.IP "v4.2\t20 Mar 92"Info-ZIP (zip-bugs subgroup, GRR).IP "v5.0\t21 Aug 92"Info-ZIP (zip-bugs subgroup, GRR).IP "v5.01\t15 Jan 93"Info-ZIP (zip-bugs subgroup, GRR).IP "v5.1\t\ 7 Feb 94"Info-ZIP (zip-bugs subgroup, GRR).IP "v5.11\t\ 2 Aug 94"Info-ZIP (zip-bugs subgroup, GRR).IP "v5.12\t28 Aug 94"Info-ZIP (zip-bugs subgroup, GRR).PD

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -