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

📄 vms_zip.rnh

📁 给出了 zip 压缩算法的完整实现过程。
💻 RNH
📖 第 1 页 / 共 2 页
字号:
.skUnder VMS, -d is case sensitive when it matches names in the zip file.This allows deleting names that were zipped on other systems, but requiresthat the names be entered in upper case if they were zipped on an MSDOSsystem (by PKZIP or in PKZIP compatibility mode), so that the names can befound in the zip file and deleted..!------------------------------------------------------------------------------.indent -42 More_Options.brAs mentioned before, Zip will use the best of two methods: deflate or store.The option -0 will force Zip to use store on all files. For example:.sk;.indent 10zip -r0 foo foo.dir.skwill zip up the directory foo into foo.zip using only store..skThe speed of deflation can also be controlled with options -1 (fastestmethod but less compression) to -9 (best compression but slower). Thedefault value is -6. For example:.sk;.indent 10zip -r8 foo foo.dir.skIn nearly all cases, a file that is already compressed cannot be compressedfurther by Zip, or if it can, the effect is minimal.  The -n optionprevents Zip from trying to compress files that have thegiven suffixes.  Such files are simply stored (0%compression) in theoutput zip file, so that Zip doesn't waste its time trying to compressthem. The suffixes are separated byeither colons or semicolons.  For example, in DCL:.sk.indent 10;$ zip -rn ".Z:.zip:.tiff:.gif:.snd" foo [.FOO]*.*.skwill put everything in [.FOO] into FOO.ZIP, but will store any files that endin .Z, .ZIP, .TIFF, .GIF, or .SND without trying to compress them.  (Image andsound files often have their own specialized compression methods.)The default suffix list is ".Z:.zip;.zoo:.arc:.lzh:.arj".The environment variable ZIPOPT can be used to change this default. Forexample:.sk.indent 10;$ ZIPOPT == "-n .Z:.zip:.tiff:.gif:.snd".skThe variable ZIPOPT can be used for any option (except -i and -x)and can include several options..skFor VMS Zip, the alternatively environment variable name ZIP_OPTS maybe used, if a more "VMS-like" name is prefered. If both ZIPOPT andZIP_OPTS are present (and do not equate to whitespace only),the content of ZIPOPT takes precedence and ZIP_OPTS is ignored..skUnder Unix, Zip will store the full path (relative to the current path)and name of the file (or just the name if -j is specified) in the zipfile along with the Unix attributes, and it will mark the entry as madeunder Unix.  If the zip file is intended for PKUNZIP under MSDOS, thenthe -k (Katz) option should be used to attempt to convert the names andpaths to conform to MSDOS, store only the MSDOS attribute (just theuser write attribute from Unix), and mark the entry as made under MSDOS(even though it wasn't)..skThe -o (older) option will set the "last modified" time of the zip file tothe latest "last modified" time of the entries in the zip file.  This canbe used without any other operations, if desired.  For example:.sk;.indent 10$ zip -o foo.skwill change the last modified time of FOO.ZIP to the latest time of theentries in FOO.ZIP..skThe -e and -c options operate on all files updated or added to the zipfile.  Encryption (-e) will prompt for a password on the terminal and willnot echo the password as it is typed (if SYS$COMMAND is not a TTY, Zip willexit with an error). New zip entries will be encrypted using that password.For added peace of mind, Zip will prompt for the password a second time,checking that the two inputs are the same before using it..skOne-line comments can be added for each file with the -c option.  The zipfile operations (adding or updating) will be done first, and you will thenbe prompted for a one-line comment for each file.  You can then enter thecomment followed by return, or just return for no comment..skThe -z option will prompt you for a multi-line comment for the entire zipfile.  This option can be used by itself, or in combination with otheroptions.  The comment is ended by a line containing just a period, or anend of file condition (^D on Unix, ^Z on MSDOS, OS/2, and OpenVMS)..skThe -q (quiet) option eliminates the informational messages and commentprompts while Zip is operating.  This might be used in shell scripts, forexample, or if the zip operation is being performed as a background task("$ spawn/nowait zip -q foo *.c")..skZip can take a list of file names to operate on from SYS$INPUT using the"-@"option..!  In Unix, this option can be used with the find command to extend.!greatly the functionality of Zip. For example, to zip up all the C source.!files in the current directory and its subdirectories, you can:.!.sk.!find . -type f -name "*.[ch]" -print | zip source -@.!.sk.!Note that the pattern must be quoted to keep the shell from expanding it..skThe -X option (remember to quote it!) suppresses saving of additional"extra file attributes" in the zipfile. Its effect is to disable theVMS only -V option (see below), and prevent storing of UNIX compatibleGMT modification time stamps. These UNIX compatible GMT time stamps-- which are quite useful when transporting Zip archives world wide (butare only recognized by Info-ZIP's UnZip 5.20 or later) --are included in the zipfile unless -X or -V is specified (in case yourversion of Zip has the USE_EF_UT_TIME option compiled in)..skUnder VMS only, the -w option will append the version number of the filesto the name and zip up multiple versions of files.  Without -w, Zip willonly use the most recent version of the specified file(s)..skOne more option that valid only under VMS is -V option. This option savesall (hopefully) file attributes needed to make EXACT copy of thefile after extraction from archive. To extract a file with saved attributes,use UnZip version 5.20 or later. Note that to specify this option you shouldquote it ("-V"). Be carefull: it's rather hard (if possible at all) to extracta file archived on VMS with this option specified on other systems. Seedocumentation on UnZip for further information..skThe -l option translates the Unix end-of-line character LF into theMSDOS convention CR LF. This option should not be used on binary files.This option can be used on Unix or VMS if the zip file is intended forPKUNZIP under MSDOS..skIf Zip is run with the -h option, or with no arguments and standard output isa terminal, the license and the command-argument and option help is shown..skThe -L option shows the Zip license..skThe -v option, when given as the only command line argument, directs Zip todisplay diagnostic information that shows when and how the executable wasbuilt and set up. This includes info on used compiler and compiler version(if available) as well as any optional compile time feature flags.Additionally, the content of the environment variables(logical names) read by Zip for runtime configuration are shown. Thisinformation is especially valuable when reporting problems or bugs..!------------------------------------------------------------------------------.indent -42 Diagnostics.br       On VMS, Zip's UNIX style exit values are mapped into proper       VMS status codes:.literal   1                                  (success)  normal exit,   (0x7fff0000 + 16*Zip_error_level)  warnings   (0x7fff0002 + 16*Zip_error_level)  normal errors   (0x7fff0004 + 16*Zip_error_level)  fatal errors.end literal       The Zip error level (or exit code) approximates the exit       codes defined by PKWARE and takes on the following values:.literal  VMS        Zip      Type of error  severity   errcode    -          0      normal; no errors or warnings detected.    F          2      unexpected end of zip file.    E          3      a generic error in the  zipfile  format  was                      detected.   Processing  may  have  completed                      successfully anyway;  some  broken  zipfiles                      created by other archivers have simple work-                      arounds.    F          4      zip was unable to allocate memory for one or                      more  buffers during program initialization.    F          5      a severe error in  the  zipfile  format  was                      detected.   Processing probably failed imme-                      diately.    E          6      entry too large to be split with zipsplit    E          7      invalid comment format    F          8      zip -T failed or out of memory    E          9      the user aborted zip prematurely  with  con-                      trol-C (or similar)    F          10     zip  encountered an error while using a temp                      file    F          11     read or seek error    W          12     zip has nothing to do    E          13     missing or empty zip file    F          14     error writing to a file    F          15     zip was unable to create a file to write to    E          16     bad command line parameters    E          18     zip could not open a specified file to read.end literal.!------------------------------------------------------------------------------.indent -42 Copyright.br     Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly,     Onno van der Linden, Christian Spieler and Igor Mandrichenko.     Permission is granted to any individual or institution to use, copy, or     redistribute this software so long as all of the original files are     included, that it is not sold for profit, and that this copyright     notice is retained..sk     LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED UTILITIES     ARE PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER     EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE     LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE..sk     Please send bug reports or comments by email to:     Zip-Bugs@lists.wku.edu.  For bug reports, please include     the version of Zip (see zip -h), the make options you used to     compile it (see zip -v), the machine and operating system you are using,     and as much additional information as possible.     Thank you for your support..!------------------------------------------------------------------------------.indent -42 Acknowledgements.br     Thanks to R. P. Byrne  for  his  Shrink.Pas  program,  which     inspired  this  project, and from which the shrink algorithm     was stolen; to Phil Katz for placing in  the  public  domain     the  zip  file format, compression format, and .ZIP filename     extension, and for accepting minor changes to the file  for-     mat; to Steve Burg for clarifications on the deflate format;     to Keith Petersen, Rich Wales, Hunter Goatley and Mark Adler     for  providing  a mailing list and ftp site for the Info-ZIP     group to use; and most importantly, to  the  Info-ZIP  group     itself  (listed in the file infozip.who) without whose tire-     less testing and bug-fixing efforts a portable zip would not     have  been  possible.   Finally  we should thank (blame) the     first Info-ZIP moderator, David Kirschbaum, for  getting  us     into  this  mess  in  the  first place..!------------------------------------------------------------------------------.indent -42 Bugs.sk     Zip 2.2 is not compatible with PKUNZIP 1.10. Use Zip 1.1 instead     to produce zip archives which can be extracted by PKUNZIP 1.10..sk     WARNING: zip files produced by this version of zip must not be     *updated* by zip 1.0 or PKZIP 1.10 or PKZIP 1.93a, if they contain     encrypted members, or if they have been produced in a pipe or on a non     seekable device. The old versions of zip or pkzip would destroy the     zip structure. The old versions can list the contents of the zip file     but cannot extract it anyway (because of the new compression algorithm).     If you do not use encryption and use regular disk files, you do     not have to care about this problem..sk     Under VMS, not all of the odd file formats are treated properly.     Only zip files of format stream-LF and fixed length 512 byte are     expected to work with Zip.  Others can be converted using Rahul     Dhesi's BILF program.  This version of Zip handles some of the     conversion internally.  The use of the "-V" option to save the     VMS attributes should work without problem for at least all types     of sequential files.  Beginning with Zip 2.2, the "-V" option uses     a new format to store the VMS attributes that should now allow     proper restoration of all sorts of indexed files. It has been     approved that there are problems with VMS UnZip to restore some     indexed files which were saved with previous versions of Zip..sk     When using Kermit to transfer zip files from VMS to MSDOS, type "set     file type block" on the VMS side.  When transfering from MSDOS to VMS,     type "set file type fixed" on the VMS machine.  In both cases, type     "set file type binary" on MSDOS..sk     Under VMS, zip hangs for file specification that uses DECnet     syntax (foo::*.*)..sk     LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED UTILITIES     ARE PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER     EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE     LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE..sk     That having been said, please send any problems or comments     via email to the Internet address Zip-Bugs@lists.wku.edu.  For     bug reports, please include the version of Zip, the make     options you used to compile it, the machine and operating     system you are using, and as much additional information as     possible.  Thank you for your support..!------------------------------------------------------------------------------

⌨️ 快捷键说明

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