unix/Makefile, unreduce.c, unzip.c, unzpriv.h, vms/descrip_deps.mms,
vms/descrip_mkdeps.mms) [Peter Backes, SMS]
-6.10c16 (11 Mar 2015):
+6.10c16 (18 Mar 2015):
- Changed the ZipInfo version numbering to use the same value as the
the corresponding UnZip version. So, what would have been ZipInfo
version 3.10 will instead be designated version 6.10 (like UnZip).
introduced new defects. Some accommodation was attempted for
Windows, but not tested. (extract.c, fileio.c, globals.c, globals.h,
process.c, unix/unix.c, unix/unxcfg.h, unzip.c, unzpriv.h) [SMS]
- - Changed behavior on non-VMS systems for the "rename" option in
- interactive file-system conflict resolution queries ("replace XXX ?
- [y]es, [n]o, [A]ll, [N]one, [r]ename:"). Previously, the "-d exdir"
- extraction directory could be added to a user-specified file-system
- path which was a relative path (but not to an absolute path). This
- was confusing, because the path name shown in the query already
- included this directory, so a reasonable copy+paste operation could
- result in the extraction directory being added a second time. Now,
- the "-d exdir" extraction directory is added to an archive path (when
- it is transformed to a file-system path), and not to a path which is
- already a file-system path (like a "rename" path). Define the C
- macro EXDIR_RENAME to restore the old behavior. Not yet changed on
- obsolete systems, pending user requests (and testing on popular
- systems). Added a space before the "?" in the query message to help
- with copy+paste activity. (atari/ataricfg.h (new), beos/beocfg.h,
- beos/beos.c, unix/unxcfg.h, unix/unix.c, unzip.c, unzpriv.h,
- win32/win32.c, win32/w32cfg.h) [SMS]
+ - Added tentative, experimental-grade support for segmented
+ (multi-part) archives. Patch contributed by pstodulk.
+ Forum topic: http://www.info-zip.org/phpBB3/viewtopic.php?f=4&t=455
+ Currently, only multiple segment files on one volume ("split"
+ archive), with name extensions ".z01", ".z02", ..., ".zip" are
+ supported; multiple volumes ("spanned" archive) are not.
+ (extract.c, fileio.c, globals.c, globals.h, process.c, unzip.c,
+ unzpriv.h, vms/vms.c, zipinfo.c, zos/vmmvs.c) [pstodulk, SMS]
Bugs fixed:
- Spelling changes. (COPYING.OLD, tandem/README) [SMS]
- Removed some dead code. (unzip.c) [SMS]
-6.10c16 (11 Mar 2015)
+6.10c16 (18 Mar 2015)
- VMS MMS/MMK builder problems:
- Faulty CLEAN_TEST rule could cause failure to remove all test
files/directories.
-so/--show_options, --version, and some program identification
information was obsolete. (unzip.c, unzpriv.h, vms/cmdline.c,
zipinfo.c) [SMS]
+ - Changed behavior on non-VMS systems for the "rename" option in
+ interactive file-system conflict resolution queries ("replace XXX ?
+ [y]es, [n]o, [A]ll, [N]one, [r]ename:"). Previously, the "-d exdir"
+ extraction directory could be added to a user-specified file-system
+ path which was a relative path (but not to an absolute path). This
+ was confusing, because the path name shown in the query already
+ included this directory, so a reasonable copy+paste operation could
+ result in the extraction directory being added a second time. Now,
+ the "-d exdir" extraction directory is added to an archive path (when
+ it is transformed to a file-system path), and not to a path which is
+ already a file-system path (like a "rename" path). Define the C
+ macro EXDIR_RENAME to restore the old behavior. Not yet changed on
+ obsolete systems, pending user requests (and testing on popular
+ systems). Added a space before the "?" in the query message to help
+ with copy+paste activity. (atari/ataricfg.h (new), beos/beocfg.h,
+ beos/beos.c, unix/unxcfg.h, unix/unix.c, unzip.c, unzpriv.h,
+ win32/win32.c, win32/w32cfg.h) [SMS]
- Changed behavior on Windows systems with Unicode support enabled
(NO_UNICODE_SUPPORT not defined). Previously, action messages
("extracting:", "inflating:", and so on) showed the archive member
path/name, not the destination file-system path/name, as was done
when Unicode support was disabled (or on non-Windows systems).
Similarly, the wrong name could be shown in interactive file-system
- conflict resolution queries, as described in the Features section,
- above. Some related code reorganization changed some variable names
- in non-Windows-specific modules. (consts.h, extract.c, globals.h,
- unix/unix.c, unzip.c, unzpriv.h, vms/vms.c) [SMS]
+ conflict resolution queries, as described above. Some related code
+ reorganization changed some variable names in non-Windows-specific
+ modules. (consts.h, extract.c, globals.h, unix/unix.c, unzip.c,
+ unzpriv.h, vms/vms.c) [SMS]
------------------------
Program version: 6.10c (BETA)
- Document date: 2015-01-02
+ Document date: 2015-03-18
------------------------------------------------------------------------
- "-v" report includes some raw hexadecimal values along with the old
descriptions/interpretations.
+- Behavior change: Interactive queries to resolve file-system conflicts
+ ("replace XXX ? [y]es, [n]o, [A]ll, [N]one, [r]ename:") were buggy.
+ Previously, on some system types, the path/name shown in the query
+ could be an archive path/name, not a file-system path/name. Also, a
+ "-d exdir" extraction directory could be added to a user-specified
+ "rename" path/name, which may already have included it. Now, the
+ query should always show the file-system path/name which has the
+ conflict (including the effects of any "-d exdir" or "-j[=N]"
+ options), and a user-specified "rename" (file-system) path/name should
+ be used as-specified.
+
- New -da/--auto-extract-dir option to specify a destination directory
for extracted files which is derived from the base name of the
archive. For example, with -da, extraction of "fred.zip" is done into
--- /dev/null
+1 UnZip\r
+\r
+ UnZip lists, tests, or extracts files from a ZIP archive (an archive\r
+ format commonly used on many different systems). The default\r
+ behavior (with no options) is to extract into the current directory\r
+ (and subdirectories below it) all files from the specified ZIP\r
+ archive. A companion program, Zip, creates ZIP archives.\r
+\r
+ Info-ZIP UnZip and Zip were intended to be compatible with archives\r
+ created by PKWARE's PKZIP and PKUNZIP programs (originally for\r
+ MS-DOS), but in many cases the program options or default behaviors\r
+ differ. Nowadays, many other programs are available which work with\r
+ ZIP archives.\r
+\r
+ This help file describes the Unix-style command-line edition of\r
+ UnZip. A VMS CLI edition is also available, with a separate help\r
+ file.\r
+\r
+ Format\r
+\r
+ unzip [ unzip_options ] [ file[.zip] ] [ member ... ]\r
+ unzip -Z [ zipinfo_options ] [ file[.zip] ] [ member ... ]\r
+\r
+ Note: Beginning with UnZip version 6.10, the old command-line\r
+ parser has been replaced by one like the one used in Zip. One\r
+ significant change is that option negation now uses a TRAILING\r
+ hyphen ("-"), so, for example, -B- negates the -B option. This\r
+ change was made because a double hyphen ("--") now introduces a long\r
+ option.\r
+\r
+ To display the basic built-in help, use the command:\r
+ unzip -h\r
+\r
+ To display the extended built-in help, use the command:\r
+ unzip -hh\r
+\r
+ The built-in help may be more current than this help file,\r
+ especially between full product releases.\r
+\r
+ To list all available options for a particular UnZip program, use\r
+ the command:\r
+ unzip --show-options\r
+\r
+ This report will not include any options which are available only on\r
+ other system types, or options which must be enabled at build-time\r
+ but were not enabled in the particular UnZip program being used.\r
+2 Command_Parameters\r
+\r
+file[.zip]\r
+\r
+ File path/name of a ZIP archive. A wildcard name may be used to\r
+ specify multiple ZIP archives to be processed in one command. On\r
+ VMS systems, any of the standard wildcards for a directory/file\r
+ specification may be used: "...", "*", or "%" (or, since VMS V7.2,\r
+ "?"). The default archive file specification is ".ZIP".\r
+\r
+ Note that a ".zip" or ".ZIP" file type on an archive is merely a\r
+ convention, not a requirement. For example, a self-extracting ZIP\r
+ archive named "fred" or "fred.exe" could be processed as if it were\r
+ an ordinary archive; just specify the actual file name with its\r
+ actual name ending (if any), whatever that may be.\r
+\r
+member ...\r
+\r
+ An optional list of archive members to be processed, separated by\r
+ spaces. If no member list is specified, then all archive members\r
+ are processed. Unix-like ("globbing") wildcard patterns may be used\r
+ to match multiple members:\r
+\r
+ * Matches a sequence of 0 or more characters.\r
+ ? Matches exactly 1 character.\r
+ [...] Matches any single character found inside the brackets.\r
+ Ranges are specified by a beginning character, a hyphen, and\r
+ an ending character. If an exclamation point ("!") or a\r
+ caret ("^") follows the left bracket, then the range of\r
+ characters within the brackets is complemented. That is,\r
+ anything except the characters inside the brackets is\r
+ considered a match. To specify a literal left bracket, use\r
+ the three-character sequence "[[]".\r
+2 Options_Primary_Mode\r
+ Options in this group specify the primary mode of operation of\r
+ UnZip. Only one of these primary mode options may be specified.\r
+\r
+ Note that uppercase options (like -T) must be specified in quotes\r
+ (unless SET PROCESS/PARSE_STYLE=EXTENDED is set). For example:\r
+\r
+ unzip "-VX" -a zipfile\r
+3 -c\r
+-c\r
+--to-stdout\r
+\r
+ Primary Mode. Extract files to stdout/screen. This option is\r
+ similar to the -p option except that the name of each file is\r
+ displayed as it is extracted, and the -a option is allowed, which\r
+ can provide automatic ASCII-EBCDIC conversion, where appropriate.\r
+3 -f\r
+-f\r
+--freshen\r
+\r
+ Primary Mode. Freshen existing files. That is, extract only those\r
+ files that already exist on disk and that are newer than the disk\r
+ copies. By default UnZip queries before overwriting, but the -o\r
+ option may be used to suppress the queries.\r
+3 -h\r
+-h\r
+--help\r
+\r
+ Primary Mode. Display brief (roughly 24 lines) usage instructions.\r
+ See also -hh.\r
+3 -hh\r
+-hh\r
+--long-help\r
+\r
+ Primary Mode. Display extended help (more complete usage\r
+ instructions). See also -h.\r
+3 -l\r
+-l\r
+--list\r
+\r
+ Primary Mode. List archive members. By default, a brief format is\r
+ used, which includes the following items: member name, uncompressed\r
+ file size ("Length"), and modification date-time of the member. A\r
+ summary is included at the end of the report, showing total size and\r
+ count for all the members in the report. Specifying a member list\r
+ limits the report to those members.\r
+\r
+ Adding -v (--verbose) to an "unzip -l" command line adds the\r
+ following items to the report: compression method, compressed size\r
+ ("Size"), compression ratio, and 32-bit CRC.\r
+\r
+ In contrast to some other programs, UnZip does not include the\r
+ 12-byte encryption header in the compressed size values for a\r
+ Traditionally encrypted member. Therefore, compressed size and\r
+ compression ratio figures are independent of the member's encryption\r
+ status and show the correct compression performance. (The complete\r
+ size of the encrypted compressed data stream for archive members is\r
+ reported by the more verbose ZipInfo reports. See ZipInfo.\r
+\r
+ If UnZip was built with OS2_EAS enabled, then the -l report also\r
+ includes the sizes of stored OS/2 extended attributes (EAs) and OS/2\r
+ access control lists (ACLs). In addition, the archive comment and\r
+ individual member comments (if any) are displayed.\r
+\r
+ If a file was archived from a single-case file system (for example,\r
+ the old MS-DOS FAT file system) and the -L option was given, the\r
+ filename is converted to lowercase and is shown prefixed with a\r
+ caret (^).\r
+\r
+ Note: If only -v (--verbose) is specified with an archive name,\r
+ then UnZip acts as if "-l -v" were specified, and a detailed listing\r
+ is generated.\r
+3 --license\r
+\r
+ Primary Mode. Display the Info-ZIP license.\r
+3 -p\r
+-p\r
+--pipe-to-stdout\r
+\r
+ Primary Mode. Extract files to stdout (pipe). Only the actual file\r
+ data for the members are sent to stdout (no file names, or other\r
+ information, as would be displayed with -c, and the files are always\r
+ extracted in binary format, just as they are stored (no\r
+ conversions).\r
+3 -T\r
+-T\r
+--timestamp-new\r
+\r
+ Primary Mode. Set the timestamp on the archive(s) to that of the\r
+ newest file in each one. This corresponds to Zip's -go option,\r
+ except that it can be used on wildcard archives (for example, "unzip\r
+ -T *.zip"), and is much faster.\r
+3 -t\r
+-t\r
+--test\r
+\r
+ Primary Mode. Test archive members. Testing means that each\r
+ archive member is extracted in memory (expanding and decrypting, as\r
+ needed), but not written to a file. The resulting CRC (cyclic\r
+ redundancy check, an enhanced checksum) of the extracted data is\r
+ then compared with the original file's stored CRC value, and an\r
+ error message is emitted if a CRC mismatch is detected.\r
+\r
+ Adding -v to -t adds some diagnostic information to the report for\r
+ archive members with LZMA or PPMd compression.\r
+3 -u\r
+-u\r
+--update\r
+\r
+ Primary mode. Update existing files and create new ones if needed.\r
+ This mode performs the same function as the Freshen (-f) mode,\r
+ extracting (with query) files that are newer than those with the\r
+ same name on disk, but it also extracts those files that do not\r
+ already exist on disk.\r
+3 -v\r
+-v\r
+--verbose\r
+\r
+ Primary mode (when alone) or option. When used as a primary mode\r
+ (alone), and no archive is specified, an "unzip -v" command\r
+ generates a report showing the program version, build options, and\r
+ relevant envrironment variables.\r
+\r
+ When used with some other primary mode option, -v can make output\r
+ more verbose (detailed).\r
+\r
+ If no other primary mode is specified, and an archive is specified,\r
+ then UnZip acts as if "-l -v" were specified, and a detailed listing\r
+ is generated. See -l.\r
+3 -z\r
+-z\r
+--zipfile-comment\r
+\r
+ Primary mode. Display only the archive comment.\r
+2 Options_Ordinary\r
+ Options in this group modify the operation of UnZip.\r
+\r
+ Note that uppercase options (like -V) must be specified in quotes\r
+ (unless SET PROC/PARSE=EXTEND is set). For example:\r
+\r
+ unzip "-VX" -a zipfile\r
+\r
+3 -2\r
+-2\r
+--force-ods2\r
+\r
+ [VMS] Convert extracted file names to ODS2-compatible names, even on\r
+ an ODS5 file system. By default, if the destination file system is\r
+ ODS5, case is preserved, and extended file name characters are\r
+ caret-escaped as needed, while if the destination file system is\r
+ ODS2, invalid characters are replaced by underscores.\r
+3 -A\r
+-A\r
+--api-help\r
+\r
+ [OS/2, Unix DLL] Print extended help for the DLL's application\r
+ programming interface (API).\r
+3 -a\r
+-a\r
+--ascii\r
+\r
+ Convert text files. Ordinarily, all files are extracted exactly as\r
+ they are stored, byte-for-byte. With -a, line endings in a text\r
+ file are adjusted to the local standard as the file is extracted.\r
+ When appropriate, ASCII<-->EBCDIC conversion is also done.\r
+\r
+ Zip (or a similar archiving program) identifies files as "binary" or\r
+ "text" when they are archived. (A short-format ZipInfo report\r
+ denotes a binary file with a "b", and a text file with a "t".) Zip's\r
+ identification of text files may not be perfect, so UnZip prints\r
+ "[binary]" or "[text]" as a visual check for each file it extracts\r
+ with -a. The -aa option forces all files to be extracted (and\r
+ converted) as text, regardless of the supposed file type.\r
+\r
+ [VMS] On VMS, for archives with VMS attribute information (made with\r
+ "zip -V"), files are always created with their original record\r
+ formats. For archives without VMS attribute information (not made\r
+ with "zip -V"), all files are normally created with Stream_LF record\r
+ format. With -a, text files are normally created with\r
+ variable-length record format, but adding -S gives them Stream_LF\r
+ record format. With -aa, all files are treated as text files. See\r
+ also -b and -S.\r
+3 -B\r
+-B\r
+--backup\r
+\r
+ [when built with UNIXBACKUP enabled] Save a backup copy of each\r
+ overwritten file. The backup file gets the name of the target file\r
+ with a tilde and optionally a unique sequence number (up to 5\r
+ digits) appended. The sequence number is appended whenever another\r
+ file with the original name plus tilde already exists. When used\r
+ together with the "overwrite all" option, -o, numbered backup files\r
+ are never created. In this case, all backup files are named as the\r
+ original file with an appended tilde, and existing backup files are\r
+ deleted without notice. This feature works similarly to the default\r
+ behavior of emacs(1) in many locations.\r
+\r
+ Example: the old copy of "foo" is renamed to "foo~".\r
+\r
+ Warning: Users should be aware that the -B option does not prevent\r
+ loss of existing data under all circumstances. For example, when\r
+ UnZip is run in overwrite-all mode, an existing "foo~" file is\r
+ deleted before UnZip attempts to rename "foo" to "foo~". When this\r
+ rename attempt fails (because of a file lock, insufficient\r
+ privileges, or any other reason), the extraction of "foo~" gets\r
+ cancelled, but the old backup file is already lost. A similar\r
+ scenario takes place when the sequence number range for numbered\r
+ backup files gets exhausted (99999, or 65535 for 16-bit systems).\r
+ In this case, the backup file with the maximum sequence number is\r
+ deleted and replaced by the new backup version without notice.\r
+3 -b\r
+-b\r
+--binary\r
+\r
+ [Tandem, VMS] Selects the file record format used when extracting\r
+ binary files. -b may conflict or interact with -a in different ways\r
+ on different system types. -b is ignored on systems other than\r
+ Tandem and VMS.\r
+\r
+ Zip (or a similar archiving program) identifies files as "binary" or\r
+ "text" when they are archived. (A short-format ZipInfo report\r
+ denotes a binary file with a "b", and a text file with a "t".)\r
+\r
+ [Tandem] Force the creation files with filecode type 180 ('C') when\r
+ extracting archive members marked as "text". (On Tandem, -a is\r
+ enabled by default, see above).\r
+\r
+ [VMS] On VMS, for archives with VMS attribute information (made with\r
+ "zip -V"), files are always created with their original record\r
+ formats. For archives without VMS attribute information (not made\r
+ with "zip -V"), files are normally created with Stream_LF record\r
+ format. With -b, binary files are created with fixed-length,\r
+ 512-byte record format. With -bb, all files are created with\r
+ fixed-length, 512-byte record format. When extracting to standard\r
+ output (-c or -p option in effect), the default conversion of text\r
+ record delimiters is disabled for binary files (with -b), or for all\r
+ files (with -bb).\r
+3 -C\r
+-c\r
+--ignore-case ([CMS, MVS] --CMS-MVS-lower)\r
+\r
+ Use case-insensitive name matching for names in the member list and\r
+ the -x excluded-member list on the command line. By default,\r
+ case-sensitive matching is done. For example, specifying "makefile"\r
+ on the command line will match only "makefile" in the archive, not\r
+ "Makefile" or "MAKEFILE". On many systems, the local file system is\r
+ case-insensitive, so case-insensitive name matching would be more\r
+ natural. With -C, "makefile" would match "makefile", "Makefile", or\r
+ "MAKEFILE".\r
+\r
+ -C does not affect the search for the ZIP archive file(s), nor the\r
+ matching of archive members to existing files on the extraction\r
+ path. So, on a case-sensitive file system, UnZip will never try to\r
+ overwrite a file "FOO" when extracting a member named "foo"!\r
+3 -c\r
+-c\r
+--to-stdout\r
+\r
+ Primary Mode. Extract files to stdout/screen. For details, see\r
+ Options_Primary_Mode.\r
+3 -D\r
+-D\r
+--dir-timestamps\r
+\r
+ Control timestamps on extracted files and directories. By default,\r
+ UnZip restores timestamps for extracted files, but not for\r
+ directories it creates. Specifying -D tells UnZip not to restore\r
+ any timestamps. Specifying -D- tells UnZip to restore timestamps\r
+ for directories as well as other items. -D- works only on systems\r
+ that support setting timestamps for directories (currently ATheOS,\r
+ BeOS, MacOS, OS/2, Unix, VMS, Win32). On other systems, -D- has no\r
+ effect.\r
+\r
+ [Non-VMS] Timestamp restoration behavior changed between UnZip\r
+ versions 6.00 and 6.10. The following table shows the effects of\r
+ various -D options for both versions.\r
+\r
+ UnZip version |\r
+ 6.00 | 6.10 | Restore timestamps on:\r
+ -----------+-----------+------------------------\r
+ -DD | -D | Nothing.\r
+ -D | (default) | Files, not directories.\r
+ (default) | -D- | Files and directories.\r
+\r
+ [VMS] The old behavior on VMS was the same as the new behavior on\r
+ all systems. (The old negated --D option is now -D-, because of\r
+ changes to the command-line parser.)\r
+3 -d\r
+-d dest_dir\r
+--extract-dir dest_dir\r
+\r
+ Specifies a destination directory for extracted files. By default,\r
+ files are extracted (and subdirectories created) in the current\r
+ directory. With "-d dest_dir", extraction is done into the\r
+ specified directory, instead. See also -da.\r
+\r
+ The option and directory may be concatenated without any white space\r
+ between them, but this may cause normal shell behavior to be\r
+ suppressed. For example, "-d ~" (tilde) is expanded by Unix shells\r
+ into the name of the user's home directory, but "-d~" is treated as\r
+ a literal "~" subdirectory of the current directory.\r
+\r
+ [VMS] On VMS, only a VMS-style device:[directory] specification is\r
+ permitted.\r
+3 -d\r
+-da[=reuse]\r
+--auto-extract-dir[=reuse]\r
+\r
+ Specifies a destination directory for extracted files which is\r
+ derived from the base name of the archive. By default, files are\r
+ extracted (and subdirectories created) in the current default\r
+ directory. With -da, UnZip automatically derives a subdirectory\r
+ name from the archive name, creates that subdirectory, and extracts\r
+ files into that subdirectory.\r
+\r
+ For example, with -da, extraction of "fred.zip" is done into\r
+ subdirectory "[.fred]" instead of into the current directory. (On\r
+ non-VMS, systems, subdirectory "fred".)\r
+\r
+ For greater safety, by default, UnZip will refuse to extract into an\r
+ automatic extraction directory which already exists. Specifying the\r
+ optional keyword "reuse" will allow an existing directory to be\r
+ used.\r
+\r
+ If -da is specified as a default option in an environment variable,\r
+ it can be overridden by either a negated -da- option or an explicit\r
+ "-d dest_dir" option. See also -d.\r
+3 -f\r
+-f\r
+--freshen\r
+\r
+ Primary Mode. Freshen existing files. For details, see\r
+ Options_Primary_Mode.\r
+3 -h\r
+-h\r
+--help\r
+\r
+ Primary Mode. Display brief (roughly 24 lines) usage instructions.\r
+ For details, see Options_Primary_Mode.\r
+3 -hh\r
+-hh\r
+--long-help\r
+\r
+ Primary Mode. Display complete usage instructions. For details,\r
+ see Options_Primary_Mode.\r
+3 -i\r
+-i\r
+--no-mac-ef-names\r
+\r
+ [MacOS (pre-OS-X)] Ignore filenames stored in MacOS extra fields.\r
+ Instead, the most compatible filename stored in the generic part of\r
+ the member's header is used.\r
+3 -J\r
+-J\r
+--junk-attrs\r
+\r
+ [BeOS] Junk file attributes. The file's BeOS file attributes are\r
+ not restored, only the file's data.\r
+\r
+ [MacOS] Ignore MacOS extra fields. All Macintosh-specific info is\r
+ skipped. AppleDouble files are restored as separate files.\r
+3 -j\r
+-j[=depth]\r
+--junk-dirs[=depth]\r
+\r
+ Junk directories on extracted files. With -j, all directory\r
+ information is stripped from an archive member name, so all files\r
+ are extracted into the destination directory. (See also -d.)\r
+\r
+ If a depth ("=depth", where "depth" is a positive integer) is\r
+ specified, then that number of directory levels will be stripped\r
+ from an archive member name. For example, an archive member like\r
+ "a/b/c/d/ee.txt" would normally be extracted as "[.a.b.c.d]ee.txt".\r
+ With -j, it would be extracted as "ee.txt". With -j=2, the first\r
+ two directory levels would be stripped, so it would be extracted as\r
+ "[.c.d]ee.txt".\r
+3 --jar\r
+\r
+ Treat archive(s) as Java JAR. Over-simplification in Java JAR\r
+ archives can cause UnZip to transform UTF-8 file names according to\r
+ inappropriate (MS-DOS) rules, yielding corrupt names on extracted\r
+ files (typically those with ASCII codes 128-255). Archives\r
+ containing a Java "CAFE" extra field should be detected\r
+ automatically, and handled correctly, but not all JAR archives\r
+ include that extra field. Specifying --jar tells UnZip to expect\r
+ UTF-8 file names, regardless of whether the archive contains a\r
+ "CAFE" extra field.\r
+3 -K\r
+-K\r
+--keep-s-attrs\r
+\r
+ [AtheOS, BeOS, Unix] Retain SUID/SGID/Tacky permission bits. By\r
+ default, these permission bits are cleared, for security reasons.\r
+3 -k\r
+--keep-permissions\r
+\r
+ [AtheOS, BeOS, Unix, VMS] Control how archived permissions or\r
+ protections are restored on extracted files and directories.\r
+\r
+ By default, archived permissions are restored with some limitations.\r
+ On AtheOS, BeOS, and Unix, the current umask value is applied (to\r
+ the normal user/group/other permissions). On VMS, the current\r
+ default protection is applied to the UIC-based (SOGW) protections.\r
+\r
+ With -k, the archived permissions are restored without regard to the\r
+ Unix umask or VMS default protection. (This was the default\r
+ behavior in UnZip versions before 6.10.)\r
+\r
+ With -k-, the archived permissions are ignored, so only the Unix\r
+ umask or VMS default protection is effective. (On VMS, directories\r
+ are always created without any Delete access.)\r
+\r
+ On AtheOS, BeOS, and Unix, the SUID/SGID/Tacky permission bits are\r
+ controlled by the -K/--keep-s-attrs option, regardless of the\r
+ -k/--keep-permissions setting.\r
+3 -ka\r
+--keep-acl [VMS] Restore ACLs on extracted files and directories.\r
+3 -L\r
+-L\r
+--lowercase-names\r
+\r
+ Convert to lowercase any filename originating on an uppercase-only\r
+ operating system or file system. (This was UnZip's default behavior\r
+ in versions before 5.11. The current default behavior is the same\r
+ as the old behavior with the -U option. -U is now used for another\r
+ purpose.)\r
+\r
+ Depending on the archiver, files archived from single-case file\r
+ systems (old MS-DOS FAT, VMS ODS2, and so on) may be stored as\r
+ all-uppercase names; this can be ugly or inconvenient when\r
+ extracting to a case-preserving file system such as OS/2 HPFS or a\r
+ case-sensitive one such as on Unix. By default UnZip lists and\r
+ extracts such filenames exactly as they're stored (excepting\r
+ truncation, conversion of unsupported characters, an so on). With\r
+ -L, the names of all files from certain systems will be converted to\r
+ lowercase. With -LL, all file names will be down-cased, regardless\r
+ of the originating file system.\r
+3 -l\r
+-l\r
+--list\r
+\r
+ Primary Mode. List archive members. For details, see\r
+ Options_Primary_Mode.\r
+3 -M\r
+-M ([CMS,MVS] Or: " -m )\r
+--more\r
+\r
+ Pipe all output through an internal pager similar to the Unix\r
+ more(1) command. At the end of a screenful of output, UnZip pauses\r
+ with a "--More--" prompt; the next screenful may be viewed by\r
+ pressing the Enter (Return) key or the space bar. UnZip can be\r
+ terminated by pressing the "q" key and, on some systems, the\r
+ Enter/Return key. Unlike Unix more(1), there is no\r
+ forward-searching or editing capability. Also, UnZip doesn't notice\r
+ if long lines wrap at the edge of the screen, effectively resulting\r
+ in the printing of two or more lines and the likelihood that some\r
+ text will scroll off the top of the screen before being viewed. If\r
+ the actual number of lines on the screen can not be determined, 24\r
+ lines will be assumed.\r
+3 -mc\r
+-mc\r
+--member-counts\r
+\r
+ Control inclusion of separate member counts for directories, files,\r
+ and links, after the totals summary at the end of the report. By\r
+ default, they are included. Use "-mc-" or "--member-counts-" to\r
+ suppress them. See also -t.\r
+3 -N\r
+-N\r
+--comment-to-note\r
+\r
+ [Amiga] Extract member comments as Amiga filenotes. Member comments\r
+ are created with the -c option of Zip, or with the -N option of the\r
+ Amiga port of Zip, which stores filenotes as comments.\r
+3 -n\r
+-n\r
+--never-overwrite\r
+\r
+ When extracting, never overwrite existing files. If a file already\r
+ exists, skip the extraction of that file without asking. See also\r
+ -o (--overwrite).\r
+\r
+ By default, UnZip queries the user before extracting any file that\r
+ already exists. The user may choose to overwrite only the current\r
+ file, overwrite all files, skip extraction of the current file, skip\r
+ extraction of all existing files, or rename the current file (choose\r
+ a new name for the extracted file).\r
+\r
+ [VMS] On VMS, the usual query choices are to create a new version of\r
+ an existing file, to skip extraction, or to rename the current file.\r
+ In the case where an archive member name includes a version number,\r
+ and -V ("retain VMS file version numbers") is in effect, then an\r
+ additional query choice is offered: to overwrite the existing file.\r
+3 -O\r
+-O\r
+--oem-char-set char_set\r
+\r
+ [Unix] Select OEM character set char_set.\r
+3 -o\r
+-o\r
+--overwrite\r
+\r
+ Always overwrite existing files without prompting. This is a\r
+ dangerous option, so use it with care. (It is often used with -f,\r
+ however, and is the only way to overwrite directory EAs on OS/2.)\r
+\r
+ By default, UnZip queries the user before extracting any file that\r
+ already exists.\r
+\r
+ [Non-VMS] On non-VMS systems, the user may choose to overwrite only\r
+ the current file, overwrite all files, skip extraction of the\r
+ current file, skip extraction of all existing files, or rename the\r
+ current file (choose a new name for the extracted file).\r
+\r
+ [VMS] On VMS, the usual query choices are to create a new version of\r
+ an existing file, to skip extraction, or to rename the current file.\r
+ In the case where an archive member name includes a version number,\r
+ and -V ("retain VMS file version numbers") is in effect, then an\r
+ additional query choice is offered: to overwrite the existing file.\r
+ In this case, -o selects the "new version" choice, and -oo (or "-o\r
+ -o") selects the "overwrite" choice.\r
+3 -P\r
+-P password\r
+--password password\r
+\r
+ Use "password" to decrypt encrypted archive members (if any). THIS\r
+ IS INSECURE! Many multi-user operating systems provide ways for any\r
+ user to see the current command line of any other user. Even on\r
+ stand-alone systems, there is always the threat of over-the-shoulder\r
+ peeking. Storing the plaintext password as part of a command line\r
+ in an automated script can be even less secure, Whenever possible,\r
+ use the non-echoing, interactive prompt to enter passwords. Where\r
+ security is truly important, use a strong encryption method, such as\r
+ AES, instead of the relatively weak encryption provided by\r
+ Traditional ZIP encryption. Or, use an external encryption program,\r
+ such as GnuPG, before archiving the file. (Note that Zip will\r
+ probably not be able to do significant compression on a file which\r
+ has already been encrypted.)\r
+3 -p\r
+-p\r
+--pipe-to-stdout\r
+\r
+ Primary Mode. Extract files to stdout (pipe). For details, see\r
+ Options_Primary_Mode.\r
+3 -q\r
+-q\r
+--quiet\r
+\r
+ Perform operations quietly. (-qq: even more quietly). By default,\r
+ UnZip prints the names of the files it's extracting or testing, the\r
+ extraction methods, any member or archive comments that may be\r
+ stored in the archive, and possibly a summary when finished with\r
+ each archive. The -q[q] options suppress the printing of some or\r
+ all of these messages.\r
+3 -r\r
+-r\r
+--remove-exts\r
+\r
+ [Tandem] Remove file extensions.\r
+3 -S\r
+-S\r
+--streamlf\r
+\r
+ [VMS] Use Stream_LF record format when converting extracted text\r
+ files (-a, -aa), instead of the text-file default, variable-length\r
+ record format.\r
+\r
+ [VMS] On VMS, for archives with VMS attribute information (made with\r
+ "zip -V"), files are always created with their original record\r
+ formats. For archives without VMS attribute information (not made\r
+ with "zip -V"), all files are normally created with Stream_LF record\r
+ format. With -a, text files are normally created with\r
+ variable-length record format, but adding -S gives them Stream_LF\r
+ record format. With -aa, all files are treated as text files. See\r
+ also -a and -b.\r
+3 -s\r
+-s\r
+--space-to-uscore\r
+\r
+ [OS/2, NT, MS-DOS] Convert spaces in filenames to underscores.\r
+ Because all these operating systems allow spaces in filenames, UnZip\r
+ normally extracts filenames with spaces intact (for example, "EA\r
+ DATA. SF"). Working with such file names can be awkward, however,\r
+ so -s can be used to replace spaces with underscores.\r
+3 -sc\r
+-sc\r
+--show-command\r
+\r
+ Show processed command line (options, arguments), and then exit.\r
+\r
+ Strictly speaking this is a primary-mode option, but it's intended\r
+ for use in program development, not in normal use.\r
+3 -si\r
+-si\r
+--show-pid\r
+\r
+ [Non-VMS] Show the UnZip program's process ID (pid) before\r
+ performing any other work. This value can then be used in a "kill\r
+ -USR1 pid" command to trigger a user-triggered progress report.\r
+3 -so\r
+-so\r
+--show-options\r
+\r
+ Display all valid program options, then exit.\r
+\r
+ Strictly speaking this is a primary-mode option, but it's intended\r
+ for use in program development, not in normal use.\r
+3 -T\r
+-T\r
+--timestamp-new\r
+\r
+ Primary Mode. Set the timestamp on the archive(s) to that of the\r
+ newest file in each one. For details, see Options_Primary_Mode.\r
+3 -t\r
+-t\r
+--test\r
+\r
+ Primary Mode. Test archive members. For details, see\r
+ Options_Primary_Mode.\r
+3 -U\r
+-U\r
+--unicode\r
+\r
+ [UNICODE_SUPPORT] Control UTF-8 handling. When UNICODE_SUPPORT is\r
+ available, -U forces UnZip to escape all non-ASCII characters from\r
+ UTF-8 coded filenames as "#Uxxxx' (for UCS-2 characters, or\r
+ "#Lxxxxxx" for Unicode codepoints needing 3 octets). This option is\r
+ mainly provided for debugging purpose when the fairly new UTF-8\r
+ support is suspected to mangle up extracted filenames.\r
+\r
+ -UU disables the recognition of UTF-8 encoded filenames. The\r
+ handling of filename codings within UnZip falls back to the behavior\r
+ of previous versions.\r
+\r
+ [old, obsolete usage] Leave filenames uppercase if created on\r
+ MS-DOS, VMS, and so on. See -L.\r
+3 -u\r
+-u\r
+--update\r
+\r
+ Primary mode. Update existing files and create new ones if needed.\r
+ For details, see Options_Primary_Mode.\r
+3 -V\r
+-V\r
+--keep-versions\r
+\r
+ [Non-CMS-MVS] Retain VMS file version numbers. VMS files can be\r
+ stored with a version number, in the format "file.type;##", where\r
+ "##" is a decimal number. By default the ";##" version numbers are\r
+ stripped, but this option allows them to be retained. (On file\r
+ systems that limit filenames to particularly short lengths, the\r
+ version numbers may be truncated or stripped regardless of this\r
+ option.)\r
+\r
+ [Non-VMS] Note that before UnZip version 6.10, on a non-VMS system,\r
+ a file with a name like "fred;123" would, by default, be extracted\r
+ as "fred", even if the file did not originate on a VMS system (so\r
+ that ";123" was probably not really a VMS version number).\r
+ Beginning with UnZip version 6.10, the default behavior is to strip\r
+ VMS version numbers only from files which were archived on a VMS\r
+ system. To restore the old behavior, and always strip apparent VMS\r
+ version numbers, explicitly negate the option: "-V-".\r
+3 -v\r
+-v\r
+--verbose\r
+\r
+ When used with some primary mode option, -v can make output more\r
+ verbose. See also Primary Mode options, and -l in particular.\r
+\r
+ Note: If only -v (--verbose) is specified with an archive name,\r
+ then UnZip acts as if "-l -v" were specified, and a detailed listing\r
+ is generated.\r
+3 -W\r
+-W\r
+--wild-no-span\r
+\r
+ [WILD_STOP_AT_DIR] (Valid when the program was built with the C\r
+ macro WILD_STOP_AT_DIR defined.) By default, the wildcard characters\r
+ "?" (single-character wildcard) and "*" (multi-character wildcard)\r
+ match any character in a member path/name. "-W" modifies the\r
+ pattern-matching behavior for archive members so that both "?"\r
+ (single-character wildcard) and "*" (multi-character wildcard) do\r
+ not match the directory separator character "/". (The two-character\r
+ sequence "**" acts as a multi-character wildcard that includes the\r
+ directory separator in its matched characters.) For example, with\r
+ "-W":\r
+\r
+ "*.c" matches "foo.c" but not "mydir/foo.c"\r
+ "**.c" matches both "foo.c" and "mydir/foo.c"\r
+ "*/*.c" matches "bar/foo.c" but not "baz/bar/foo.c"\r
+ "??*/*" matches "ab/foo" and "abc/foo"\r
+ but not "a/foo" or "a/b/foo"\r
+\r
+ This modified behavior is equivalent to the pattern matching style\r
+ used by the shells of some of UnZip's supported target OSs (one\r
+ example is Acorn RISC OS). This option may not be available on\r
+ systems where the Zip archive's internal directory separator\r
+ character "/" is allowed as regular character in native operating\r
+ system filenames.\r
+\r
+ [non-VMS] Currently, UnZip uses the same pattern matching rules for\r
+ both wildcard archive file name specifications and archive member\r
+ selection patterns on most system types. For systems allowing "/"\r
+ as regular filename character, the -W option would not work as\r
+ expected on a wildcard file name specification.\r
+3 -X\r
+-X\r
+--restore-info\r
+\r
+ [VMS, Unix, OS/2, NT, Tandem] Restore owner/protection info (UICs\r
+ and ACL entries on VMS, or user and group info (UID/GID) on Unix, or\r
+ access control lists (ACLs) on certain network-enabled versions of\r
+ OS/2 (Warp Server with IBM LAN Server/Requester 3.0 to 5.0; Warp\r
+ Connect with IBM Peer 1.0), or security ACLs on Windows NT.) In most\r
+ cases this will require special system privileges, and doubling the\r
+ option (-XX) on NT instructs UnZip to use privileges for extraction;\r
+ but on Unix, for example, a user who belongs to several groups can\r
+ restore files owned by any of those groups, so long as the user IDs\r
+ match the user's own. Note that ordinary file attributes are always\r
+ restored. This option applies only to optional, extra ownership\r
+ info available on some operating systems. (NT's access control\r
+ lists do not appear to be especially compatible with OS/2's, so no\r
+ attempt is made at cross-platform portability of access privileges.\r
+ It is not clear under which conditions this would ever be useful\r
+ anyway.)\r
+3 -x\r
+-x member ...\r
+--exclude member ...\r
+\r
+ An optional list of archive members to be excluded from processing.\r
+ Because wildcard characters normally match "/" directory separators\r
+ (for exceptions see the option -W), this option may be used to\r
+ exclude any files that are in subdirectories. For example, "unzip\r
+ foo *.[ch] -x */*" would extract all C source files (*.c, *.h) in\r
+ the main directory, but none in any subdirectories. Without the -x\r
+ option, all C source files in all directories within the archive\r
+ would be extracted.\r
+\r
+ When the program sees -x (--exclude) on a command line, it stops\r
+ scanning for options, and treats every succeeding item as an archive\r
+ member name. To avoid confusion between member names and command\r
+ options, it's simplest to specify -x (--exclude) and its member list\r
+ as the last items on a command line. Alternatively, the special\r
+ name "@" can be used to terminate the member list (and cause the\r
+ program to resume scanning for options). That is, the following two\r
+ commands are equivalent:\r
+\r
+ unzip fred.zip -b -x file1 file2 file3\r
+ unzip fred.zip -x file1 file2 file3 @ -b\r
+3 -Y\r
+-Y\r
+--dot-version\r
+\r
+ [VMS] Treat archive member name endings of ".nnn" (where "nnn" is a\r
+ decimal number) as if they were VMS version numbers (";nnn"). (The\r
+ default is to treat them as file types.) For example:\r
+\r
+ "a.b.3" -> "a.b;3"\r
+3 -Z\r
+-Z\r
+--zipinfo-mode\r
+\r
+ ZipInfo mode. If the first option on the command line is -Z, then\r
+ the program runs in ZipInfo mode, which is used to display\r
+ information about an archive and its members. Remaining options are\r
+ interpreted as ZipInfo options. See ZipInfo_mode.\r
+3 -z\r
+-z\r
+--zipfile-comment\r
+\r
+ Primary mode. Display only the archive comment. For details, see\r
+ Options_Primary_Mode.\r
+3 -$\r
+-$\r
+--volume-labels\r
+\r
+ [MS-DOS, OS/2, NT] Restore the volume label if the extraction medium\r
+ is removable (for example, a diskette). Doubling the option (-$$)\r
+ allows fixed media (hard disks) to be labeled as well. By default,\r
+ volume labels are ignored.\r
+3 -/\r
+-/\r
+--extensions\r
+\r
+ [Acorn] Overrides the extension list supplied by the Unzip$Ext\r
+ environment variable. During extraction, filename extensions that\r
+ match one of the items in this extension list are swapped in front\r
+ of the base name of the extracted file.\r
+3 -:\r
+-:\r
+--do-double-dots\r
+\r
+ [all but Acorn, VM/CMS, MVS, Tandem] Allows UnZip to extract archive\r
+ members into locations outside of the current extraction destination\r
+ directory (and its subdirectories).\r
+\r
+ For security reasons, UnZip normally removes "parent directory" path\r
+ components ("../") from the path names of archive members as they\r
+ are extracted. This safety feature (new for version 5.50) prevents\r
+ UnZip from accidentally writing files to directories outside the\r
+ current destination directory tree. The -: option sets UnZip back\r
+ to its previous, more liberal behavior, allowing exact extraction of\r
+ archives that use "../" path components to create multiple directory\r
+ trees at or above the level of the destination directory.\r
+\r
+ This option does not enable writing explicitly to the root directory\r
+ ("/"). To achieve this, it is necessary to set the extraction\r
+ target folder to "/" (by using an option like "-d /"). However,\r
+ when the -: option is specified, it is still possible implicitly to\r
+ write to the root directory if member paths specifying enough "../"\r
+ path components.\r
+\r
+ Use this option with extreme caution.\r
+3 -^\r
+-^\r
+--control-in-name\r
+\r
+ [Unix] Allow control characters in file names of extracted ZIP\r
+ archive members. On Unix, a file name may contain any (8-bit)\r
+ character code with the two exceptions of "/" (the directory\r
+ delimiter) and NUL (0x00, the C string-termination character),\r
+ unless the specific file system has more restrictive conventions.\r
+ Generally, this allows embedding ASCII control characters or escape\r
+ sequences in file names. However, this feature allows the use of\r
+ malicious file names which can cause various kinds of bad trouble\r
+ when displayed on a user's terminal/emulator. (Even a file name\r
+ with unprintable but otherwise harmless characters can cause\r
+ problems for users.)\r
+\r
+ For these reasons, by default, UnZip applies a filter that removes\r
+ potentially dangerous control characters from the extracted file\r
+ names. The -^ option overrides this filter in the rare case that\r
+ embedded filename dangerous control characters are to be\r
+ intentionally restored.\r
+2 Environment_Options\r
+ UnZip's default behavior may be modified by placing command-line\r
+ options in an environment variable. This can be done with any\r
+ option, but it is probably most useful options like -a (auto-convert\r
+ text files), -L (downcase file names from systems with all uppercase\r
+ file names), -C (use case-insensitive name matching), -q (quiet), -o\r
+ (always overwrite), or -n (never overwrite).\r
+\r
+ For UnZip, the environment variable name on VMS is UNZIP_OPTS\r
+ (non-VMS: UNZIP). The name on VMS is different to avoid conflict\r
+ with a foreign-command DCL symbol, UNZIP. For compatibility with\r
+ Zip, if UNZIP_OPTS is not defined, then UnZip will use UNZIPOPT the\r
+ same way.\r
+\r
+ For ZipInfo ("unzip -Z"), the environment variable name on VMS is\r
+ ZIPINFO_OPTS (non-VMS: ZIPINFO). For compatibility with Zip, if\r
+ ZIPINFO_OPTS is not defined, then ZipInfo will use ZIPINFOOPT the\r
+ same way.\r
+\r
+ For example, to make UnZip act as quietly as possible, only\r
+ reporting errors, one could use commands like the following:\r
+\r
+ Unix Bourne (or similar) shell:\r
+ UNZIP='-q -q'; export UNZIP\r
+\r
+ Unix C shell:\r
+ setenv UNZIP '-q -q'\r
+\r
+ OS/2 or MS-DOS:\r
+ set UNZIP="-q -q"\r
+\r
+ VMS (with quotation to preserve lower case in DCL):\r
+ define UNZIP_OPTS "-q -q" ! Logical name, or\r
+ UNZIP_OPTS = "-q -q" ! DCL symbol. (Either works.)\r
+\r
+ Environment options are treated the same as any other command-line\r
+ options, except that they are effectively the first options on the\r
+ command line. To override an environment option, one may use an\r
+ explicit option to cancel or override it. For example, to override\r
+ one of the "quiet" flags in the example above, use a command like:\r
+\r
+ unzip -q- [other options] archive.zip\r
+\r
+ The leading hyphen is the normal option character, and the trailing\r
+ one negates the option, canceling one level of quietness. To cancel\r
+ multiple "quiet" flags, use multiple -q- options:\r
+\r
+ unzip -t -q- -q- archive\r
+ unzip -q- -q- -t archive\r
+\r
+ Note that multiple one-character options like "-q" and "-q" can be\r
+ combined into a single "-qq", but it's generally clearer to keep\r
+ each instance of each option separate. Similarly, negated\r
+ one-character options can be combined, as with "-q-q-", but "-q-\r
+ -q-" is generally clearer.\r
+\r
+ The examples show short (one-character) options, but long ("--")\r
+ options are also allowed.\r
+2 Encryption_Decryption\r
+ Zip and UnZip have long supported a relatively weak encryption\r
+ method, which we call Traditional ZIP encryption. The source code\r
+ for Traditional encryption is included in the source kits, and\r
+ support for Traditional encryption is enabled by default.\r
+ (Build-time C macro: CRYPT_TRAD.)\r
+\r
+ Beginning with UnZip version 6.10 and Zip version 3.1, these\r
+ programs also offer a stronger, Advanced Encryption Standard (AES)\r
+ encryption method, which we call AES WinZip/Gladman (AES_WG)\r
+ encryption. (The encryption code was supplied by Brian Gladman, and\r
+ the archive format is intended to be compatible with that used by\r
+ the WinZip program. WinZip is a registered trademark of WinZip\r
+ International LLC.) The source code for AES_WG encryption is\r
+ distributed in a separate kit (for export control reasons), and\r
+ support for AES_WG encryption must be enabled explicitly at build\r
+ time. (Build-time C macro: CRYPT_AES_WG.) See the INSTALL file in\r
+ the source kit for details on how to enable AES_WG encryption (or\r
+ how to disable Traditional encryption).\r
+\r
+ For details on the WinZip AES scheme, see:\r
+ http://www.winzip.com/aes_info.htm\r
+\r
+ For information on the separate AES_WG source kit, see:\r
+ ftp://ftp.info-zip.org/pub/infozip/crypt/\r
+ ftp://ftp.info-zip.org/pub/infozip/crypt/README_AES_WG.txt\r
+\r
+ Normally, encryption passwords are supplied by the user\r
+ interactively when requested by the program. See the -P option for\r
+ a (less secure) method of specifying a password on the command line.\r
+\r
+ With Traditional encryption, when decrypting, a password will be\r
+ checked against header data, and used if it appears to be correct.\r
+ The correct password will always check out against the header data,\r
+ but there is a 1-in-256 chance that an incorrect password will as\r
+ well. (This is a security feature of the PKWARE archive format; it\r
+ helps prevent brute-force attacks that might otherwise gain a large\r
+ speed advantage by testing only the header.) In the case that an\r
+ incorrect password is given but it passes the header test anyway,\r
+ either an incorrect CRC will be generated for the extracted data or\r
+ else UnZip will fail during the extraction because the "decrypted"\r
+ bytes do not constitute a valid compressed data stream.\r
+\r
+ If the first password fails the header check on some file, UnZip\r
+ will prompt for another password, and so on until all files are\r
+ extracted. If a password is not known, entering a null password\r
+ (that is, just a carriage return or "Enter") is taken as a signal to\r
+ skip all further prompting. Only unencrypted files in the\r
+ archive(s) will thereafter be extracted. (The situation is actually\r
+ a little more complicated. Some old versions of Zip and ZipCloak\r
+ allowed null passwords, so UnZip checks each encrypted file to see\r
+ if the null password works. This may result in "false positives"\r
+ and extraction errors, as noted above.)\r
+\r
+ Archives encrypted with 8-bit-character passwords (for example,\r
+ passwords with accented European characters) may not be portable\r
+ across systems or to other archivers. This problem stems from the\r
+ use of multiple encoding methods for such characters, including\r
+ Latin-1 (ISO 8859-1) and OEM code page 850. DOS PKZIP 2.04g uses\r
+ the OEM code page; Windows PKZIP 2.50 uses Latin-1 (and is therefore\r
+ incompatible with DOS PKZIP; Info-ZIP uses the OEM code page on DOS,\r
+ OS/2 and Win3.x ports but ISO coding (Latin-1 etc.) everywhere else;\r
+ and Nico Mak's WinZip 6.x does not allow 8-bit-character passwords\r
+ at all. UnZip 5.3 (or newer) attempts to use the default character\r
+ set first (e.g., Latin-1), followed by the alternate one (e.g., OEM\r
+ code page) to test passwords. On EBCDIC systems, if both of these\r
+ fail, EBCDIC encoding will be tested as a last resort. (EBCDIC is\r
+ not tested on non-EBCDIC systems, because there are no known\r
+ archivers that encrypt using EBCDIC encoding.) ISO character\r
+ encodings other than Latin-1 are not supported. The new addition of\r
+ (partial) Unicode (UTF-8) support in UnZip 6.0 has not yet been\r
+ adapted to the encryption password handling in UnZip. On systems\r
+ that use UTF-8 as native character encoding, UnZip simply tries\r
+ decryption with the native UTF-8 encoded password; the built-in\r
+ attempts to check the password in translated encoding have not yet\r
+ been adapted for UTF-8 support and will consequently fail.\r
+2 Examples\r
+ To use UnZip to extract all members of the archive letters.zip into\r
+ the current directory and subdirectories below it, creating any\r
+ subdirectories as necessary:\r
+\r
+ unzip letters\r
+\r
+ To extract all members of letters.zip into the current directory\r
+ only:\r
+\r
+ unzip -j letters\r
+\r
+ To test letters.zip, printing only a summary message indicating\r
+ whether the archive is OK or not:\r
+\r
+ unzip -t -q letters\r
+\r
+ To test all ".zip" archives in the current directory, printing only\r
+ the summaries:\r
+\r
+ unzip -t -q *.zip\r
+\r
+ (On a Unix system, the wildcard archive name would typically need to\r
+ be quoted to keep a a Unix shell from expanding ("globbing") it.\r
+ This is not necessary on VMS.)\r
+\r
+ The following command extracts to standard output all members of\r
+ letters.zip whose names end in ".tex", auto-converting to the local\r
+ end-of-line convention, in Stream_LF record format, and piping the\r
+ output into TYPE /PAGE:\r
+\r
+ pipe unzip -c -a -S letters *.tex | type /page sys$input\r
+\r
+ To extract from source.zip all Fortran and C source files (*.f, *.c,\r
+ *.h) and Makefile into the SYS$SCRATCH directory:\r
+\r
+ unzip source.zip *.[fch] Makefile -d sys$scratch\r
+\r
+ To extract all FORTRAN and C source files, regardless of case (for\r
+ example, both *.c and *.C, and any makefile, Makefile, MAKEFILE or\r
+ similar):\r
+\r
+ unzip -C source.zip *.[fch] makefile -d sys$scratch\r
+\r
+ The following command extracts only newer versions of the files\r
+ already in the current directory, without querying. (Note: Be\r
+ careful of extracting in one timezone an archive created in another.\r
+ ZIP archives created by Zip versions before 2.1 contain no timezone\r
+ information, and a "newer" file from an eastern timezone may, in\r
+ fact, be older):\r
+\r
+ unzip -f -o sources\r
+\r
+ To extract newer versions of the files already in the current\r
+ directory and to create any files not already there (same caveat as\r
+ previous example):\r
+\r
+ unzip -u -o sources\r
+\r
+ To display a configuration report showing the program version, the\r
+ OS and compiler used to build it, a list of optional features\r
+ enabled at build time, and the values of all the relevant\r
+ environment variables:\r
+\r
+ unzip -v\r
+\r
+ In the last five examples, assume that UNZIP_OPTS is set to -q. To\r
+ do a (singly) quiet listing:\r
+\r
+ unzip -l file.zip\r
+\r
+ To do a doubly quiet listing:\r
+\r
+ unzip -l -q file.zip\r
+\r
+ (Note that the ".zip" is generally not necessary.) To do a standard\r
+ listing:\r
+\r
+ unzip -l -q- file.zip\r
+\r
+ or:\r
+\r
+ unzip -lq- file.zip\r
+\r
+ or:\r
+\r
+ unzip -q-l file.zip\r
+\r
+2 Exit_Status\r
+ UnZip's exit status approximates the exit codes defined by PKWARE.\r
+ On VMS, UnZip's UNIX-style exit values are translated into VMS-style\r
+ status codes with facility code 1954 = %x7A2, and with the\r
+ inhibit-message (%x10000000) and facility-specific (%x00008000) bits\r
+ set:\r
+\r
+ %x17A28001 normal exit\r
+ %x17A28000 + 16*UnZip_error_code warnings\r
+ %x17A28002 + 16*UnZip_error_code normal errors\r
+ %x17A28004 + 16*UnZip_error_code fatal errors\r
+\r
+ Note that multiplying the UNIX-style UnZip error code by 16 places\r
+ it conveniently in the hexadecimal representation of the VMS exit\r
+ code, "__" in %x17A28__s, where "s" is the severity code. For\r
+ example, a missing archive might cause UnZip error code 9, which\r
+ would be transformed into the VMS exit status %X17A28092.\r
+\r
+ The UnZip VMS exit codes include severity values which approximate\r
+ those defined by PKWARE, as shown in the following table:\r
+\r
+ VMS UnZip\r
+ severity err code Error description\r
+ ----------+----------+----------------------------------------------\r
+ Success 0 Normal. No errors or warnings detected.\r
+ Warning 1 One or more warnings were encountered, but\r
+ processing completed successfully. This\r
+ includes archives where one or more (but not\r
+ all) files were skipped because of an\r
+ unsupported compression or encryption method,\r
+ or a bad encryption password.\r
+ Error 2 Error in the archive format. Processing may\r
+ or may not have completed successfully.\r
+ Fatal 3 Severe error in the archive format.\r
+ Processing probably failed immediately.\r
+ Fatal 4 Memory allocation failed in program\r
+ initialization.\r
+ Fatal 5 Memory allocation or terminal I/O failed in\r
+ password processing.\r
+ Fatal 6 Memory allocation failed while decompressing\r
+ to disk.\r
+ Fatal 7 Memory allocation failed while decompressing\r
+ in memory.\r
+ Fatal 8 Memory allocation failed. (Currently not\r
+ used.)\r
+ Error 9 Specified archive files were not found.\r
+ Error 10 Invalid command-line options or parameters.\r
+ Error 11 No matching files were found.\r
+ Fatal 50 Disk (file system) filled during extraction.\r
+ Fatal 51 Unexpected end-of-file while reading the\r
+ archive.\r
+ Error 80 User interrupt (Ctrl/C).\r
+ Error 81 No files were processed, because of\r
+ unsupported compression or encryption\r
+ methods.\r
+ Error 82 No files were processed, because of bad\r
+ encryption password(s).\r
+ Fatal 83 Large-file archive could not be processed by\r
+ this small-file program.\r
+2 Bugs\r
+ Multi-part archives are not yet supported, except in conjunction\r
+ with Zip. (All parts must be concatenated together in order, and\r
+ then "zip -F" (for Zip 2.x) or "zip -FF" (for Zip 3.x) must be\r
+ performed on the concatenated archive in order to "fix" it. Also,\r
+ zip 3.0 and later can combine multi-part (split) archives into a\r
+ combined single-file archive using "zip -s- inarchive -O\r
+ outarchive". See the zip manual page for more information.) This\r
+ may be corrected in the next major release.\r
+\r
+ Archives read from standard input are not yet supported, except with\r
+ UnZip (and then only the first member of the archive can be\r
+ extracted).\r
+\r
+ Archives encrypted with 8-bit-character passwords (such as passwords\r
+ with accented European characters) may not be portable across\r
+ systems and/or other archivers. See also Encryption_Decryption.\r
+\r
+ UnZip's -M ("--more") option tries to take into account automatic\r
+ wrapping of long lines. However, the code may fail to detect the\r
+ correct wrapping locations. First, TAB characters (and similar\r
+ control sequences) are not taken into account, they are handled as\r
+ ordinary printable characters. Second, depending on the actual\r
+ system type, UnZip may not detect the true terminal/emulator\r
+ geometry, but instead may rely on "commonly used" default\r
+ dimensions. The correct handling of tabs would require the\r
+ implementation of a query for the actual tab setup on the output\r
+ terminal/emulator.\r
+\r
+ [Unix] Unix special files such as FIFO buffers (named pipes), block\r
+ devices and character devices are not restored even if they are\r
+ somehow represented in the archive, nor are hard-linked files\r
+ relinked. Basically, the only file types restored by UnZip are\r
+ regular files, directories, and symbolic (soft) links.\r
+\r
+ [OS/2] Extended attributes for existing directories are only updated\r
+ if the -o ("--overwrite") option is given. This is a limitation of\r
+ the operating system; because directories only have a creation time\r
+ associated with them, UnZip has no way to determine whether the\r
+ stored attributes are newer or older than those on disk. In\r
+ practice this may mean a two-pass approach is required: first\r
+ unpack the archive normally (with or without freshening/updating\r
+ existing files), then overwrite just the directory entries (for\r
+ example, "unzip -o foo */").\r
+\r
+ Note that uppercase options (-C, -D, -L, -M, -P, -S, -T, -V, -X, -Y,\r
+ and -Z) must be specified in quotes (unless SET PROC/PARSE=EXTEND is\r
+ set). For example:\r
+\r
+ unzip "-VX" -a zipfile\r
+\r
+ When extracting to SYS$OUTPUT (-c or -p options) redirected to a\r
+ file, you may want to override the default text file conversion by\r
+ specifying the -b option. A single "-b" option switches to "binary\r
+ piping" mode for Zip entries marked as non-text, only. To force\r
+ "binary piping" mode even for Zip file entries marked as text, the\r
+ "-bb" option should be used. (Please note that a later "-a" cancels\r
+ any -b option, see below.)\r
+\r
+ The output conversion options -b and -a may be combined to perform\r
+ binary conversions on binary files and text conversion on text\r
+ files. But note: For compatibility with implementation on other\r
+ systems, -b cancels any -a option; to get the intended result, -a\r
+ must be specified AFTER -b. And, in combination, "text" recognition\r
+ takes precedence; this means that -bba (-bb -a) has the same effect\r
+ as -ba (-b -a), and -aa overrides binary conversion for ALL files.\r
+\r
+ The conversion option -S is only effective when used together with\r
+ -a or -aa. When specified, "text" files are written in Stream_LF\r
+ record format instead of the VMS default of Variable-Length record\r
+ format. (When no conversion options are specified, all non-VMS\r
+ entries are always written as Stream_LF files.)\r
+\r
+ Please note that using the "-P<password>" option is higly insecure,\r
+ the plaintext password may be seen by others. For this reason (and\r
+ because of lack of space), the "-P<password>" option is not\r
+ advertised on UnZip's online help screen.\r
+2 URL\r
+ The Info-ZIP main Web page is:\r
+ http://www.info-zip.org/\r
+\r
+ FTP access is available, too:\r
+ ftp://ftp.info-zip.org/pub/infozip/\r
+2 ZipInfo_mode\r
+ If the first option on the UnZip command line is "-Z", then the\r
+ program runs in ZipInfo mode. Remaining options are interpreted as\r
+ ZipInfo options.\r
+\r
+ ZipInfo reports detailed information about a ZIP archive and its\r
+ members. This information may include file access permissions,\r
+ compression method, encryption method, version and operating system\r
+ (or file system) of the archive-creating program, and so on. The\r
+ default behavior (with no options) is to show a single-line entry\r
+ for each member in the archive, with a header and a trailer\r
+ providing summary information for the entire archive. The format is\r
+ a cross between Unix "ls -l" and "unzip -lv" output. See\r
+ Detailed_Description. ZipInfo is the same program as UnZip. (On\r
+ Unix, "zipinfo" may be a link to "unzip". On VMS, "zipinfo" is\r
+ normally a DCL symbol defined as "''unzip' -Z".) However, ZipInfo\r
+ support may have been disabled when UnZip was built.\r
+\r
+ Format\r
+\r
+ zipinfo [ zipinfo_options ] [ file[.zip] ] [ member ... ]\r
+ unzip -Z [ zipinfo_options ] [ file[.zip] ] [ member ... ]\r
+3 Command_Parameters\r
+\r
+file[.zip]\r
+\r
+ File path/name of a ZIP archive. A wildcard name may be used to\r
+ specify multiple ZIP archives to be processed in one command. On\r
+ VMS systems, any of the standard wildcards for a directory/file\r
+ specification may be used: "...", "*", or "%" (or, since VMS V7.2,\r
+ "?"). The default archive file specification is "[]*.ZIP".\r
+\r
+ Note that a ".zip" or ".ZIP" file type on an archive is merely a\r
+ convention, not a requirement. For example, a self-extracting ZIP\r
+ archive named "fred" or "fred.exe" could be processed as if it were\r
+ an ordinary archive; just specify the actual file name with its\r
+ actual name ending (if any), whatever that may be.\r
+\r
+member ...\r
+\r
+ An optional list of archive members to be processed, separated by\r
+ spaces. Unix-like ("globbing") wildcard patterns may be used to\r
+ match multiple members:\r
+\r
+ * Matches a sequence of 0 or more characters.\r
+ ? Matches exactly 1 character.\r
+ [...] Matches any single character found inside the brackets.\r
+ Ranges are specified by a beginning character, a hyphen, and\r
+ an ending character. If an exclamation point ("!") or a\r
+ caret ("^") follows the left bracket, then the range of\r
+ characters within the brackets is complemented. That is,\r
+ anything except the characters inside the brackets is\r
+ considered a match. To specify a literal left bracket, use\r
+ the three-character sequence "[[]".\r
+3 Options_Primary_Format\r
+ Options in this group (-1, -2, -l, -m, -s, -v) specify the primary\r
+ report format of ZipInfo. Only one of these primary format options\r
+ may be specified.\r
+4 -1\r
+-1\r
+--names-only\r
+\r
+ Primary Format. Show member names only, one per line. This option\r
+ excludes all others, and the report does not include headers,\r
+ trailers, or archive comments. This format may be useful with Unix\r
+ shell (or other) scripts.\r
+4 -2\r
+-2\r
+--names-mostly\r
+\r
+ Primary Format. Show member names only, one per line (as with\r
+ "-1"), but allow headers (-h), trailers (-t), and archive comments\r
+ (-z), if requested explicitly.\r
+4 -l\r
+-l\r
+--long-list\r
+\r
+ Primary Format. Show member info in long Unix "ls -l" format. Like\r
+ the -m format, except that the compressed size (in bytes) is printed\r
+ instead of the compression ratio.\r
+4 -m\r
+-m\r
+--medium-list\r
+\r
+ Primary Format. Show member info in medium-length Unix "ls -l"\r
+ format. Like the -s format, except that the compression factor,\r
+ expressed as a percentage, is also included.\r
+4 -s\r
+-s\r
+--short-list\r
+\r
+ Primary Format. Show member info in short Unix "ls -l" format.\r
+ This is the default behavior, unless -h or -t is specified.\r
+4 -v\r
+-v\r
+--verbose\r
+\r
+ Primary Format. The verbose report is very detailed, and mostly\r
+ self-explanatory, but it does assume some familiarity with the ZIP\r
+ archive format. It also includes the archive comment, if any.\r
+ Extra fields in the central directory are broken dowm into\r
+ subfields, with brief descriptions of recognized subfields (or\r
+ abbreviated dumps of unrecognized subfields).\r
+3 Options_Ordinary\r
+ Options in this group modify the operation or report format of\r
+ ZipInfo.\r
+4 -C\r
+-C\r
+--ignore-case ([CMS, MVS] --CMS-MVS-lower)\r
+\r
+ Use case-insensitive name matching for names in the member list and\r
+ the -x excluded-member list on the command line. By default,\r
+ case-sensitive matching is done. For example, specifying "makefile"\r
+ on the command line will match only "makefile" in the archive, not\r
+ "Makefile" or "MAKEFILE". On many systems, the local file system is\r
+ case-insensitive, so case-insensitive name matching would be more\r
+ natural. With -C, "makefile" would match "makefile", "Makefile", or\r
+ "MAKEFILE".\r
+\r
+ /CASE_MATCH does not affect the search for the ZIP archive file(s).\r
+4 -h\r
+-h\r
+--header\r
+\r
+ Include a header in the report, showing the archive name, the\r
+ archive size (in bytes), and the number of members in the archive.\r
+\r
+ For the Unix-format reports (options -l, -m, -s), the header is\r
+ included by default, if no archive members are specified. If -h is\r
+ specified alone, that is, without one of the Unix-format options,\r
+ and without a member list, then only the header lines will be put\r
+ out.\r
+4 -M\r
+-M ([CMS,MVS] Or: -m)\r
+--more\r
+\r
+ Pipe all output through an internal pager similar to the Unix\r
+ more(1) command. At the end of a screenful of output, Zipinfo\r
+ pauses with a "--More--" prompt; the next screenful may be viewed by\r
+ pressing the Enter (Return) key or the space bar. ZipInfo can be\r
+ terminated by pressing the "q" key, or, on some systems, the\r
+ Enter/Return key. Unlike Unix more(1), there is no\r
+ forward-searching or editing capability. Also, ZipInfo doesn't\r
+ notice if long lines wrap at the edge of the screen, effectively\r
+ resulting in the printing of two or more lines and the likelihood\r
+ that some text will scroll off the top of the screen before being\r
+ viewed. If the actual number of lines on the screen can not be\r
+ determined, 24 lines will be assumed.\r
+4 -T\r
+-T\r
+--decimal-time\r
+\r
+ Show the file date-times in a sortable, all-numeric,\r
+ "YYYYMMDD.hhmmss" format. The default date format is an\r
+ alpha-numeric "YY-Mmm-DD hh:mm". For example ("-s", "-s -T"):\r
+\r
+ -rw-a-- 3.1 fat 211916 tx defX 10-Jun-18 00:27 zip31c/zip.c\r
+ -rw-a-- 3.1 fat 211916 tx defX 20100618.002703 zip31c/zip.c\r
+4 -t\r
+-t\r
+--totals\r
+\r
+ Include a totals summary at the end of the report, showing the\r
+ number of members in the report, the sum of their uncompressed\r
+ sizes, the sum of their compressed sizes, and the compression factor\r
+ as a percentage.\r
+\r
+ For the Unix-format reports (options -l, -m, -s), the totals summary\r
+ is included by default, if no archive members are specified. If -t\r
+ is specified alone, that is, without one of the Unix-format options,\r
+ and without a member list, then only the totals summary trailer\r
+ lines will be put out.\r
+\r
+ The total "bytes compressed" reported includes only the actual data,\r
+ not the ZIP archive meta-data, so the size of the archive will\r
+ always be greater than this value.\r
+\r
+ See also -mc.\r
+4 -U\r
+-U\r
+--unicode\r
+\r
+ [UNICODE_SUPPORT] Control UTF-8 handling. When UNICODE_SUPPORT is\r
+ available, -U forces ZipInfo to escape all non-ASCII characters from\r
+ UTF-8 coded filenames as "#Uxxxx" (for UCS-2 characters, or\r
+ "#Lxxxxxx" for Unicode codepoints needing 3 octets). This option is\r
+ mainly provided for debugging purpose when the fairly new UTF-8\r
+ support is suspected of damaging extracted filenames.\r
+\r
+ -UU disables the recognition of UTF-8 encoded filenames. The\r
+ handling of filename codings within ZipInfo falls back to the\r
+ behavior of pre-Unicode versions.\r
+4 -W\r
+-W\r
+--wild-no-span\r
+\r
+ [WILD_STOP_AT_DIR] (Valid when the program was built with the C\r
+ macro WILD_STOP_AT_DIR defined.) By default, the wildcard characters\r
+ "?" (single-character wildcard) and "*" (multi-character wildcard)\r
+ match any character in a member path/name. "-W" modifies the\r
+ pattern-matching behavior for archive members so that both "?"\r
+ (single-character wildcard) and "*" (multi-character wildcard) do\r
+ not match the directory separator character "/". (The two-character\r
+ sequence "**" acts as a multi-character wildcard that includes the\r
+ directory separator in its matched characters.) For example, with\r
+ "-W":\r
+\r
+ "*.c" matches "foo.c" but not "mydir/foo.c"\r
+ "**.c" matches both "foo.c" and "mydir/foo.c"\r
+ "*/*.c" matches "bar/foo.c" but not "baz/bar/foo.c"\r
+ "??*/*" matches "ab/foo" and "abc/foo"\r
+ but not "a/foo" or "a/b/foo"\r
+\r
+ This modified behavior is equivalent to the pattern matching style\r
+ used by the shells of some of UnZip's supported target OSs (one\r
+ example is Acorn RISC OS). This option may not be available on\r
+ systems where the Zip archive's internal directory separator\r
+ character "/" is allowed as regular character in native operating\r
+ system filenames. (Currently, UnZip uses the same pattern matching\r
+ rules for both wildcard archive file name specifications and archive\r
+ member selection patterns on most system types. For systems\r
+ allowing "/" as regular filename character, the -W option would not\r
+ work as expected on a wildcard file name specification.)\r
+4 -x\r
+-x member ...\r
+--exclude member ...\r
+\r
+ An optional list of archive members to be excluded from processing.\r
+ Because wildcard characters normally match "/" directory separators\r
+ (for exceptions see the option -W), this option may be used to\r
+ exclude any files that are in subdirectories. For example, "unzip\r
+ foo *.[ch] -x */*" would extract all C source files (*.c, *.h) in\r
+ the main directory, but none in any subdirectories. Without the -x\r
+ option, all C source files in all directories within the archive\r
+ would be extracted.\r
+\r
+ When the program sees -x (--exclude) on a command line, it stops\r
+ scanning for options, and treats every succeeding item as an archive\r
+ member name. To avoid confusion between member names and command\r
+ options, it's simplest to specify -x (--exclude) and its member list\r
+ as the last items on a command line. Alternatively, the special\r
+ name "@" can be used to terminate the member list (and cause the\r
+ program to resume scanning for options). That is, the following two\r
+ commands are equivalent:\r
+\r
+ zipinfo fred.zip -2 -t -x file1 file2 file3\r
+ zipinfo fred.zip -x file1 file2 file3 @ -2 -t\r
+4 -z\r
+-z\r
+--zipfile-comment\r
+\r
+ Include the archive comments (if any) in the report.\r
+3 Detailed_Description\r
+ ZipInfo has three basic report formats, providing different degrees\r
+ of detail in the information about the members of an archive: a\r
+ simple list of names (-1, -2), a Unix ls-style listing (-l, -m, -s),\r
+ and a very detailed analysis (-v). Some of the information, such as\r
+ file sizes, is easy to interpret. Some of the information involves\r
+ fairly obscure details of ZIP archive structure. ZIP archive\r
+ structure is documented in the PKWARE Inc. APPNOTE.TXT:\r
+ http://www.pkware.com/documents/casestudies/APPNOTE.TXT\r
+\r
+ The table below shows some typical -l report entries:\r
+\r
+ Perm/Prot Zver Ofs UncSize At CmpSize Cmth ModDate Mtime Name\r
+ ----------+----+---+-------+--+-------+----+---------------+----------\r
+ -rw-a-- 3.1 fat 211916 tx 53467 defX 10-Jun-18 00:27 zip3/zip.c\r
+ -rwxr-x--- 3.1 unx 709 Tx 311 aesw 11-Aug-21 22:20 endian.c\r
+ RWED,RE, 3.1 vms 6656 bx 2295 defN 07-Aug-15 14:12 it/T.EXE;8\r
+\r
+ Field 1 (Perm/Prot) shows the file permission/protection attributes,\r
+ formatted according to the original operating system or file system\r
+ where the archive was created.\r
+\r
+ Field 2 (Zver) shows the (approximate) version of the Zip program\r
+ which created the archive.\r
+\r
+ Field 3 (Ofs) shows the original operating system where the archive\r
+ was created, or the file system on which the member file was stored.\r
+\r
+ Field 4 (UncSize) shows the original, uncompressed file size.\r
+\r
+ Field 5 (At) shows some archive member attributes, as detailed in\r
+ the tables below. The first character indicates whether a file was\r
+ binary or text, and whether it was encrypted. The second character\r
+ indicates the presence of a data descriptor and/or an extra field in\r
+ the member data.\r
+\r
+ | File Type Extra Field |\r
+ First char | binary text yes no | Second char\r
+ --------------+-------+----- ------+-----+--------------------\r
+ Encrypted no | b t x - | no Data Descriptor\r
+ yes | B T X l | yes\r
+\r
+ A Data Descriptor holds CRC and size data at an alternate place in\r
+ the archive (after processed member data instead of before), and is\r
+ normally used when the archiving program can't seek in the output\r
+ archive data/file. An Extra Field can hold a wide variety of data,\r
+ including 64-bit file sizes, many kinds of OS-specific attribute\r
+ data, UTC times, and so on.\r
+\r
+ Field 6 (CmpSize) shows the compressed file size. With -m, this\r
+ field shows the compression fraction as a percentage. With -s (the\r
+ default), this field is omitted. This compressed size value (unlike\r
+ the one in an "unzip -l" report) includes all the overhead resulting\r
+ from Traditional encryption.\r
+\r
+ Field 7 (Cmth) shows the compression method used. Note that AES_WG\r
+ encryption is treated as a compression method here. Not all of the\r
+ methods shown in the table below are supported. (Some are\r
+ obsolete.)\r
+\r
+ Num Abbr Name, description\r
+ ----+----+------------------------------------------------------------\r
+ 0 stor Store (no compression)\r
+ 1 shrk Shrink\r
+ 2 re:1 Reduce (factor 1)\r
+ 3 re:2 Reduce (factor 2)\r
+ 4 re:3 Reduce (factor 3)\r
+ 5 re:4 Reduce (factor 4)\r
+ 6 i#:# Implode (dictonary_size:Shannon-Fano_trees)\r
+ 7 tokn Tokenize\r
+ 8 def# Deflate (N: normal, X: maximum, F: fast, S: super-fast)\r
+ 9 d64# Deflate64 (N: normal, X: maximum, F: fast, S: super-fast)\r
+ 10 dcli PKWARE Data Compression Library Imploding - IBM TERSE (old)\r
+ 12 bzp2 bzip2\r
+ 14 lzma LZMA\r
+ 18 ters IBM TERSE (new)\r
+ 19 lz77 IBM LZ77 z Architecture (PFS)\r
+ 96 jpeg JPEG\r
+ 97 wavp WavPack\r
+ 98 ppmd PPMd version I, Rev 1\r
+ 99 aesw AES_WG encryption\r
+\r
+ Fields 8 and 9 (ModDate, Mtime) show the file modification date-time\r
+ (MS-DOS format, local time).\r
+\r
+ Field 10 (Name) shows the file path/name.\r
+3 Environment_Options\r
+ ZipInfo's default behavior may be modified by placing command-line\r
+ options in an environment variable. This can be done with any\r
+ option, but it is probably most useful options like -T (decimal time\r
+ format) or one of the non-default Unix format options: -l, -m.\r
+\r
+ For ZipInfo ("unzip -Z"), the environment variable name on VMS is\r
+ ZIPINFO_OPTS (non-VMS: ZIPINFO). For compatibility with Zip, if\r
+ ZIPINFO_OPTS is not defined, then ZipInfo will use ZIPINFOOPT the\r
+ same way.\r
+\r
+ For example, to make the default format the long Unix format instead\r
+ of the short Unix format, one could use commands like the following:\r
+\r
+ Unix Bourne (or similar) shell:\r
+ ZIPINFO='-l'; export UNZIP\r
+\r
+ Unix C shell:\r
+ setenv ZIPINFO '-l'\r
+\r
+ OS/2 or MS-DOS:\r
+ set ZIPINFO="-l"\r
+\r
+ VMS (with quotation to preserve lower case in DCL):\r
+ define ZIPINFO_OPTS "-l" ! Logical name, or\r
+ ZIPINFO_OPTS = "-l" ! DCL symbol. (Either works.)\r
+\r
+ Environment options are treated the same as any other command-line\r
+ options, except that they are effectively the first options on the\r
+ command line. To override an environment option, one may use an\r
+ explicit option to cancel or override it. For example, to disable\r
+ the totals trailer line by default, one could use commands like the\r
+ following:\r
+\r
+ Unix Bourne (or similar) shell:\r
+ ZIPINFO='-t-'; export ZIPINFO\r
+\r
+ Unix C shell:\r
+ setenv ZIPINFO '-t-'\r
+\r
+ VMS (with quotation to preserve lower case in DCL):\r
+ define ZIPINFO_OPTS "-t-" ! Logical name, or\r
+ ZIPINFO_OPTS = "-t-" ! DCL symbol. (Either works.)\r
+\r
+ The examples show short (one-character) options, but long ("--")\r
+ options are also allowed.\r
+3 Examples\r
+ To get a basic, short-format listing of the complete contents of a\r
+ ZIP archive zip31c.zip, with both header and totals lines, use only\r
+ the archive name as an argument to zipinfo:\r
+\r
+ zipinfo zip31c.zip\r
+ zipinfo zip31c\r
+\r
+ To produce a basic, long-format listing (not verbose), including\r
+ header and totals lines, use -l:\r
+\r
+ zipinfo -l zip31c.zip\r
+\r
+ To list the complete contents of the archive without header and\r
+ totals lines, either negate the -h and -t options or else specify\r
+ the contents explicitly:\r
+\r
+ zipinfo -h- -t- zip31c.zip\r
+ zipinfo zip31c.zip *\r
+\r
+ (On a Unix system, the wildcard member name would typically need to\r
+ be quoted to keep a a Unix shell from expanding ("globbing") it.\r
+ This is not necessary on VMS.)\r
+\r
+ To list information on a single archive member, in medium format,\r
+ specify the member name explicitly:\r
+\r
+ zipinfo -m unzip60.zip */unshrink.c\r
+\r
+ When any member name is specified, the header and totals trailer\r
+ are, by default, not included in the report, but explicitly\r
+ specifying -h and/or -t will restore them. For example:\r
+\r
+ zipinfo -m -t unzip610b.zip *.[ch] */Make*\r
+\r
+ On a Unix system, one could use the -T option along with an external\r
+ sorting program (and another filter like "head" or "tail") to get a\r
+ listing of the least or most recently modified files in the archive:\r
+\r
+ zipinfo -l -T -h- -t- zip31c.zip | sort -k 8 | head -12\r
+ zipinfo -l -T -h- -t- zip31c.zip | sort -r -k 8 | head -12\r
+\r
+ The "sort" option "-k 8" tells it to sort on field 8, which is the\r
+ date-time field in a long- or medium-format (-l, -m) ZipInfo report.\r
+ (Use "-k 7" for the short (-s) format.) The -r option reverses the\r
+ default smallest-to-largest sort order.\r
+3 Bugs\r
+ As with UnZip, ZipInfo's -M ("--more") option is overly simplistic\r
+ in its handling of screen output. As noted above, it fails to\r
+ detect the wrapping of long lines and may thereby cause lines at the\r
+ top of the screen to be scrolled off before being read. ZipInfo\r
+ should detect and treat each occurrence of line-wrap as one\r
+ additional line printed. This requires knowledge of the screen's\r
+ width as well as its height. In addition, ZipInfo should detect the\r
+ true screen geometry on all systems.\r
+\r
+ The interactions among the various listing format, header, and\r
+ trailer options (-h, -l, -m, -s, -t) are unnecessarily complex and\r
+ should be simplified, despite the potential disruption to current\r
+ users.\r
+3 URL\r
+ The Info-ZIP main Web page is:\r
+ http://www.info-zip.org/\r
+\r
+ FTP access is available, too:\r
+ ftp://ftp.info-zip.org/pub/infozip/\r
--- /dev/null
+1 UNZIP\r
+ UnZip lists, tests, or extracts files from a ZIP archive (an\r
+ archive format commonly used on many different systems). The\r
+ default behavior (with no options) is to extract into the current\r
+ directory (and subdirectories below it) all files from the\r
+ specified ZIP archive. A companion program, Zip, creates ZIP\r
+ archives.\r
+\r
+ Info-ZIP UnZip and Zip were intended to be compatible with archives\r
+ created by PKWARE's PKZIP and PKUNZIP programs (originally for\r
+ MS-DOS), but in many cases the program options or default behaviors\r
+ differ. Nowadays, many other programs are available which work\r
+ with ZIP archives.\r
+\r
+ This help file describes the VMS CLI edition of UnZip. A\r
+ Unix-style command-line edition is also available, with a separate\r
+ help file.\r
+\r
+ The VMS CLI edition of UnZip adds a command-line translator to the\r
+ normal UnZip program. This translator transforms a set of\r
+ VMS-style qualifiers and parameters into an equivalent set of\r
+ Unix-style options and parameters, and then passes those\r
+ transformed arguments to UnZip's standard Unix-style command-line\r
+ processor. The documentation often shows the related Unix-style\r
+ options in parentheses after a VMS-style qualifier. For example:\r
+ /HELP (-h, -hh).\r
+\r
+ Format:\r
+\r
+ UNZIP [/unzip_qualifiers] [file[.zip]] [member [,...]]\r
+\r
+ UNZIP /ZIPINFO [/zipinfo_qualifiers] [file[.zip]] [member [,...]]\r
+\r
+ ZIPINFO [/zipinfo_qualifiers] [file[.zip]] [member [,...]]\r
+\r
+ To display the basic built-in help, use the command:\r
+\r
+ UNZIP /HELP\r
+\r
+ To display the extended built-in help, use the command:\r
+\r
+ UNZIP /HELP=EXTENDED\r
+\r
+ The built-in help may be more current than this help file,\r
+ especially between full product releases.\r
+\r
+ The VMS CLI edition of the program can also provide built-in help\r
+ on the Unix-style command-line edition; just use the "-h" or "-hh"\r
+ options.\r
+2 Command_Parameters\r
+ file[.zip]\r
+\r
+ File path/name of a ZIP archive. A wildcard name may be used to\r
+ specify multiple ZIP archives to be processed in one command.\r
+ On VMS systems, any of the standard wildcards for a\r
+ directory/file specification may be used: "...", "*", or "%"\r
+ (or, since VMS V7.2, "?"). The default archive file\r
+ specification is ".ZIP".\r
+\r
+ Note that a ".zip" or ".ZIP" file type on an archive is merely a\r
+ convention, not a requirement. For example, a self-extracting\r
+ ZIP archive named "fred" or "fred.exe" could be processed as if\r
+ it were an ordinary archive; just specify the actual file name\r
+ with its actual name ending (if any), whatever that may be.\r
+\r
+ member [,...]\r
+\r
+ An optional list of archive members to be processed, separated\r
+ by commas. If no member list is specified, then all archive\r
+ members are processed. Unix-like ("globbing") wildcard patterns\r
+ may be used to match multiple members:\r
+\r
+ * Matches a sequence of 0 or more characters.\r
+ ? Matches exactly 1 character.\r
+ [...] Matches any single character found inside the brackets.\r
+ Ranges are specified by a beginning character, a hyphen,\r
+ and an ending character. If an exclamation point ("!")\r
+ or a caret ("^") follows the left bracket, then the\r
+ range of characters within the brackets is complemented.\r
+ That is, anything except the characters inside the\r
+ brackets is considered a match. To specify a literal\r
+ left bracket, use the three-character sequence "[[]".\r
+2 Qualifiers_Primary_mode\r
+ Qualifiers in this group specify the primary mode of operation of\r
+ UnZip. Only one of these primary mode qualifiers may be specified.\r
+3 /COMMENT (-z)\r
+ Primary mode. Display only the archive comment.\r
+3 /FRESHEN (-f)\r
+ Primary Mode. Freshen existing files. That is, extract only those\r
+ files that already exist on disk and that are newer than the disk\r
+ copies. By default UnZip queries before overwriting, but the\r
+ /EXISTING (-o) option may be used to suppress the queries.\r
+3 /HELP (-h, -hh)\r
+ /HELP [=NORMAL]\r
+ /HELP=EXTENDED\r
+\r
+ Primary Mode. Display brief (roughly 24 lines) usage instructions\r
+ (NORMAL, the default), or EXTENDED help (more complete usage\r
+ instructions).\r
+3 /LICENSE (--license)\r
+ Primary Mode. Display the Info-ZIP license.\r
+3 /LIST (-l)\r
+ Primary Mode. List archive members. By default, a brief format is\r
+ used, which includes the following items: member name,\r
+ uncompressed file size ("Length"), and modification date-time of\r
+ the member. A summary is included at the end of the report,\r
+ showing total size and count for all the members in the report.\r
+ Specifying a member list limits the report to those members.\r
+\r
+ Adding /VERBOSE to an "UNZIP /LIST" command line adds the following\r
+ items to the report: compression method, compressed size ("Size"),\r
+ compression ratio, and 32-bit CRC.\r
+\r
+ In contrast to some other programs, UnZip does not include the\r
+ 12-byte encryption header in the compressed size values for a\r
+ Traditionally encrypted member. Therefore, compressed size and\r
+ compression ratio figures are independent of the member's\r
+ encryption status and show the correct compression performance.\r
+ (The complete size of the encrypted compressed data stream for\r
+ archive members is reported by the more verbose ZipInfo reports.\r
+ See ZipInfo.\r
+\r
+ If UnZip was built with OS2_EAS enabled, then the /LIST report also\r
+ includes the sizes of stored OS/2 extended attributes (EAs) and\r
+ OS/2 access control lists (ACLs). In addition, the archive comment\r
+ and individual member comments (if any) are displayed.\r
+\r
+ If a file was archived from a single-case file system (for example,\r
+ the old MS-DOS FAT file system) and the /NAMES=DOWNCASE option was\r
+ given, the filename is converted to lowercase and is shown prefixed\r
+ with a caret (^).\r
+\r
+ Note: If only /VERBOSE is specified with an archive name, then\r
+ UnZip acts as if "/LIST /VERBOSE" were specified, and a detailed\r
+ listing is generated.\r
+3 /PIPE (-p)\r
+ Primary Mode. Extract files to stdout (pipe). Only the actual\r
+ file data for the members are sent to stdout (no file names, or\r
+ other information, as would be displayed with /SCREEN (-c), and the\r
+ files are always extracted in binary format, just as they are\r
+ stored (no conversions). See also /SCREEN.\r
+3 /SCREEN (-c)\r
+ Primary Mode. Extract files to stdout/screen. This option is\r
+ similar to the /PIPE (-p) option except that the name of each file\r
+ is displayed as it is extracted, and the /TEXT (-a) option is\r
+ allowed, which can provide automatic ASCII-EBCDIC conversion, where\r
+ appropriate. See also /PIPE.\r
+3 /TEST (-t)\r
+ Primary Mode. Test archive members. Testing means that each\r
+ archive member is extracted in memory (expanding and decrypting, as\r
+ needed), but not written to a file. The resulting CRC (cyclic\r
+ redundancy check, an enhanced checksum) of the extracted data is\r
+ then compared with the original file's stored CRC value, and an\r
+ error message is emitted if a CRC mismatch is detected.\r
+\r
+ Adding /VERBOSE (-v) to /TEST adds some diagnostic information to\r
+ the report for archive members with LZMA or PPMd compression.\r
+3 /TIMESTAMP (-T)\r
+ Primary Mode. Set the timestamp on the archive(s) to that of the\r
+ newest file in each one. This corresponds to Zip's /APPEND /LATEST\r
+ (-go) option, except that it can be used on wildcard archives (for\r
+ example, "unzip -T *.zip"), and is much faster.\r
+3 /UPDATE (-u)\r
+ Primary mode. Update existing files and create new ones if needed.\r
+ This mode performs the same function as the Freshen (/FRESHEN, -f)\r
+ mode, extracting (with query) files that are newer than those with\r
+ the same name on disk, but it also extracts those files that do not\r
+ already exist on disk.\r
+3 /VERBOSE (-v)\r
+\r
+ Primary mode (when alone) or option. When used as a primary mode\r
+ (alone), and no archive is specified, an "UNZIP /VERBOSE" command\r
+ generates a report showing the program version, build options, and\r
+ relevant envrironment variables.\r
+\r
+ When used with some other primary mode option, /VERBOSE can make\r
+ output more verbose (detailed).\r
+\r
+ If no other primary mode is specified, and an archive is specified,\r
+ then UnZip acts as if "/LIST /VERBOSE" were specified, and a\r
+ detailed listing is generated. See Qualifiers_Primary_mode,\r
+ particularly /LIST.\r
+2 Qualifiers_Ordinary\r
+ Qualifiers in this group modify the operation of UnZip.\r
+3 /AUTO_DIRECTORY (-da)\r
+ /NOAUTO_DIRECTORY (default)\r
+ /AUTO_DIRECTORY[=REUSE]\r
+\r
+ Specifies a destination directory for extracted files which is\r
+ derived from the base name of the archive. By default, files are\r
+ extracted (and subdirectories created) in the current default\r
+ directory. With /AUTO_DIRECTORY, UnZip automatically derives a\r
+ subdirectory name from the archive name, creates that subdirectory,\r
+ and extracts files into that subdirectory.\r
+\r
+ For example, with /AUTO_DIRECTORY, extraction of "fred.zip" is done\r
+ into subdirectory "[.fred]" instead of into the current directory.\r
+ (On non-VMS systems, subdirectory "fred".)\r
+\r
+ Using this option can help to avoid cluttering the current\r
+ directory with files extracted from an archive whose structure does\r
+ not include a top-level directory.\r
+\r
+ If -da is specified as a default option in an environment variable,\r
+ it can be overridden by either a /NOAUTO_DIRECTORY qualifier or an\r
+ explicit /DIRECTORY=dest_dir qualifier. See also /DIRECTORY.\r
+3 /BINARY (-b, -bb)\r
+ /BINARY[=keyword]\r
+ /NOBINARY (Default.)\r
+\r
+ Selects the file record format used when extracting binary files.\r
+\r
+ The optional keywords are:\r
+\r
+ ALL Extract all files with fixed-length, 512-byte record\r
+ format. (-bb)\r
+ AUTO Extract binary files with fixed-length, 512-byte\r
+ record format. (Default value keyword: "/BINARY" is\r
+ equivalent to "/BINARY=AUTO".) (-b)\r
+ NONE Same as /NOBINARY. Extract binary files with\r
+ Stream_LF record format. (Default condition.)\r
+\r
+ Zip (or a similar archiving program) identifies files as "binary"\r
+ or "text" when they are archived. (A short-format ZipInfo report\r
+ denotes a binary file with a "b", and a text file with a "t".)\r
+\r
+ [VMS] On VMS, for archives with VMS attribute information (made\r
+ with "zip -V", "ZIP /VMS"), files are always created with their\r
+ original record formats. For archives without VMS attribute\r
+ information (not made with "zip -V", "ZIP /VMS"), files are\r
+ normally created with Stream_LF record format. With\r
+ /BINARY[=AUTO], binary files are created with fixed-length,\r
+ 512-byte record format. With /BINARY=ALL, all files are created\r
+ with fixed-length, 512-byte record format. When extracting to\r
+ standard output (/PIPE or /SCREEN in effect), the default\r
+ conversion of text record delimiters is disabled for binary files\r
+ (with /BINARY[=AUTO]), or for all files (with /BINARY=ALL).\r
+\r
+ /BINARY may conflict or interact with /TEXT. A combination of\r
+ /BINARY[=AUTO] and /TEXT[=AUTO] is allowed. (See /TEXT.)\r
+3 /BRIEF\r
+ Deprecated. Ignored. A no-op place-holder, originally intended as\r
+ an opposite of /FULL (also deprecated). See\r
+ Qualifiers_Primary_mode, particularly /LIST and /VERBOSE.\r
+3 /CASE_INSENSITIVE (-C)\r
+ /CASE_INSENSITIVE\r
+ /NOCASE_INSENSITIVE (default)\r
+\r
+ Deprecated. Use /MATCH=CASE.\r
+\r
+ With /CASE_INSENSITIVE, match member names case-blindly.\r
+3 /DIRECTORY (-d)\r
+ /DIRECTORY=dest_dir\r
+\r
+ Specifies a destination directory for extracted files. By default,\r
+ files are extracted (and subdirectories created) in the current\r
+ default directory. With "/DIRECTORY=dest_dir", extraction is done\r
+ into the specified directory, instead.\r
+\r
+ [VMS] On VMS, only a VMS-style device:[directory] specification is\r
+ permitted.\r
+3 /DOT_VERSION (-Y)\r
+ [VMS] Treat archive member name endings of ".nnn" (where "nnn" is a\r
+ decimal number) as if they were VMS version numbers (";nnn"). (The\r
+ default is to treat them as file types.) For example:\r
+\r
+ "a.b.3" -> "a.b;3"\r
+3 /EXCLUDE (-x)\r
+ /EXCLUDE=(member [,...])\r
+\r
+ An optional list of archive members to be excluded from processing.\r
+ Because wildcard characters normally match "/" directory separators\r
+ (for exceptions see /MATCH=[NO]WILD_MATCH_SLASH (-W)), this option\r
+ may be used to exclude any files that are in subdirectories. For\r
+ example,\r
+ UNZIP foo *.[ch] /EXCLUDE = */*\r
+ would extract all C source files (*.c, *.h) in the main directory,\r
+ but none in any subdirectories. Without the /EXCLUDE option, all C\r
+ source files in all directories within the archive would be\r
+ extracted.\r
+\r
+ Note that archive members are specified using the Unix-style names\r
+ which are used in ZIP archives, not VMS-style names.\r
+3 /EXISTING (-n, -o)\r
+ /EXISTING[=keyword]\r
+\r
+ Specifies the action when extracting files, and a file already\r
+ exists.\r
+\r
+ The optional keywords are:\r
+\r
+ NEW_VERSION Create a new version of an existing file. (-o)\r
+ OVERWRITE Overwrite an existing file. (-oo)\r
+ NOEXTRACT Do not extract. Leave an existing file intact. (-n)\r
+\r
+ By default, UnZip queries the user before extracting any file that\r
+ already exists.\r
+\r
+ [Non-VMS] On non-VMS systems, the user may choose to overwrite only\r
+ the current file, overwrite all files, skip extraction of the\r
+ current file, skip extraction of all existing files, or rename the\r
+ current file (choose a new name for the extracted file).\r
+\r
+ [VMS] On VMS, the usual query choices are to create a new version\r
+ of an existing file, to skip extraction, or to rename the current\r
+ file. In the case where an archive member name includes a version\r
+ number, and /VERSION (-V, "retain VMS file version numbers") is in\r
+ effect, then an additional query choice is offered: to overwrite\r
+ the existing file.\r
+3 /FULL (-v)\r
+ /FULL\r
+ /FULL=DIAGNOSTICS\r
+\r
+ Deprecated. Adds detail to a /LIST report. See\r
+ Qualifiers_Primary_mode, particularly /LIST and /VERBOSE, and\r
+ Qualifiers_Ordinary, particularly /VERBOSE.\r
+3 /JAR (--jar)\r
+ Treat archive(s) as Java JAR. Over-simplification in Java JAR\r
+ archives can cause UnZip to transform UTF-8 file names according to\r
+ inappropriate (MS-DOS) rules, yielding corrupt names on extracted\r
+ files (typically those with ASCII codes 128-255). Archives\r
+ containing a Java "CAFE" extra field should be detected\r
+ automatically, and handled correctly, but not all JAR archives\r
+ include that extra field. Specifying /JAR tells UnZip to expect\r
+ UTF-8 file names, regardless of whether the archive contains a\r
+ "CAFE" extra field.\r
+3 /JUNK_DIRS (-j)\r
+ /NOJUNK_DIRS (Default.)\r
+ /JUNK_DIRS[=depth]\r
+\r
+ Junk directories on extracted files. With /JUNK_DIRS, all\r
+ directory information is stripped from an archive member name, so\r
+ all files are extracted into the destination directory. (See also\r
+ /DIRECTORY.)\r
+\r
+ If a depth ("=depth", where "depth" is a positive integer) is\r
+ specified, then that number of directory levels will be stripped\r
+ from an archive member name. For example, an archive member like\r
+ "a/b/c/d/ee.txt" would normally be extracted as "[.a.b.c.d]ee.txt".\r
+ With /JUNK_DIRS, it would be extracted as "ee.txt". With\r
+ /JUNK_DIRS=2, the first two directory levels would be stripped, so\r
+ it would be extracted as "[.c.d]ee.txt".\r
+3 /LOWERCASE (-L)\r
+ /[NO]LOWERCASE\r
+\r
+ Deprecated. Use /NAMES=[NO]DOWNCASE.\r
+\r
+ /LOWERCASE: Convert to lowercase any filename originating on an\r
+ uppercase-only operating system or file system.\r
+\r
+ /NOLOWERCASE: Do not convert to lowercase any filename originating\r
+ on an uppercase-only operating system or file system.\r
+\r
+ See also /UPPERCASE, which is also deprecated.\r
+3 /MATCH (-C, -W)\r
+ /MATCH=(keyword, ...)\r
+\r
+ Specifies name-matching behavior for names in the member list and\r
+ the /EXCLUDE excluded-member list on the command line.\r
+\r
+ The optional keywords and values are:\r
+\r
+ CASE=BLIND Name matching is case-insensitive. (-C)\r
+ CASE=SENSITIVE Name matching is case-sensitive. (Default.)\r
+\r
+ By default, case-sensitive matching is done. For example,\r
+ specifying "makefile" on the command line will match only\r
+ "makefile" in the archive, not "Makefile" or "MAKEFILE". On many\r
+ systems, the local file system is case-insensitive, so\r
+ case-insensitive name matching would be more natural. With\r
+ /MATCH=CASE=BLIND, "makefile" would match "makefile", "Makefile",\r
+ or "MAKEFILE".\r
+\r
+ /MATCH does not affect the search for the ZIP archive file(s), nor\r
+ the matching of archive members to existing files on the extraction\r
+ path. So, on a case-sensitive file system, UnZip will never try to\r
+ overwrite a file "FOO" when extracting a member named "foo"!\r
+\r
+ [WILD_STOP_AT_DIR] If the C macro WILD_STOP_AT_DIR is defined at\r
+ build time, then an additional keyword is allowed:\r
+\r
+ NOWILD_MATCH_SLASH Wildcards stop at directory slash. (-W)\r
+ WILD_MATCH_SLASH Wildcards match directory slash. (Default.)\r
+\r
+ By default, the wildcard characters "?" (single-character wildcard)\r
+ and "*" (multi-character wildcard) match any character in a member\r
+ path/name. /MATCH=NOWILD_MATCH_SLASH (-W) modifies the\r
+ pattern-matching behavior for archive members so that both "?"\r
+ (single-character wildcard) and "*" (multi-character wildcard) do\r
+ not match the directory separator character "/". (The\r
+ two-character sequence "**" acts as a multi-character wildcard that\r
+ includes the directory separator in its matched characters.) For\r
+ example, with /MATCH=NOWILD_MATCH_SLASH:\r
+\r
+ "*.c" matches "foo.c" but not "mydir/foo.c"\r
+ "**.c" matches both "foo.c" and "mydir/foo.c"\r
+ "*/*.c" matches "bar/foo.c" but not "baz/bar/foo.c"\r
+ "??*/*" matches "ab/foo" and "abc/foo"\r
+ but not "a/foo" or "a/b/foo"\r
+\r
+ This modified behavior is equivalent to the pattern matching style\r
+ used by the shells of some of \fIUnZip\fP's supported target OSs\r
+ (one example is Acorn RISC OS). This option may not be available\r
+ on systems where the Zip archive's internal directory separator\r
+ character "/" is allowed as regular character in native operating\r
+ system filenames.\r
+\r
+ [non-VMS] (Currently, UnZip uses the same pattern matching rules\r
+ for both wildcard archive file name specifications and archive\r
+ member selection patterns on most system types. For systems\r
+ allowing "/" as regular filename character, the -W option would not\r
+ work as expected on a wildcard file name specification.)\r
+3 /NAMES (-0 -2, -L, -s)\r
+ /NAMES\r
+ /NAMES=(keyword, ...)\r
+\r
+ Selects name transformations during extraction. The keywords are:\r
+\r
+ [NO]CHAR_SET CHAR_SET: Use CP850 character-set mapping on names\r
+ of archive members which originated on a FAT or\r
+ NTFS file system. (Default condition.)\r
+ NOCHAR_SET: Do not map these archive member names.\r
+ DOWNCASE Convert filenames from all-uppercase operating\r
+ systems to lowercase. (-L)\r
+ DOWNCASE=ALL Convert all filenames to lowercase. (-LL)\r
+ ODS2 Restrict names to ODS2 conventions, regardless\r
+ of the destination file system. (Invalid\r
+ character -> "_".) (-2)\r
+ [NO]SPACES SPACES: Permit space characters in (ODS5) names.\r
+ (Default condition.)\r
+ NOSPACES: Change spaces to underscores. (-s)\r
+\r
+ The default is to use ODS5-compatible file names (including spaces)\r
+ when the destination file system is ODS5, and to convert the names\r
+ to ODS2-compatible names when the destination file system is ODS2.\r
+3 /OVERWRITE (-n, -o)\r
+ /[NO]OVERWRITE\r
+\r
+ Deprecated. Use /EXISTING.\r
+\r
+ /OVERWRITE is equivalent to /EXISTING=NEW_VERSION.\r
+ /NOOVERWRITE is equivalent to /EXISTING=NOEXTRACT.\r
+3 /PAGE (-M)\r
+ Pipe all output through an internal pager similar to the Unix\r
+ more(1) command. At the end of a screenful of output, UnZip pauses\r
+ with a "--More--" prompt; the next screenful may be viewed by\r
+ pressing the Enter (Return) key or the space bar. UnZip can be\r
+ terminated by pressing the "Q" key and, on some systems, the\r
+ Enter/Return key. Unlike Unix more(1), there is no\r
+ forward-searching or editing capability. Also, UnZip doesn't\r
+ notice if long lines wrap at the edge of the screen, effectively\r
+ resulting in the printing of two or more lines and the likelihood\r
+ that some text will scroll off the top of the screen before being\r
+ viewed. If the actual number of lines on the screen can not be\r
+ determined, 24 lines will be assumed.\r
+3 /PASSWORD (-P)\r
+ /PASSWORD=password\r
+\r
+ Use "password" to decrypt encrypted archive members (if any). THIS\r
+ IS INSECURE! Many multi-user operating systems provide ways for\r
+ any user to see the current command line of any other user. Even\r
+ on stand-alone systems, there is always the threat of\r
+ over-the-shoulder peeking. Storing the plaintext password as part\r
+ of a command line in an automated script can be even less secure,\r
+ Whenever possible, use the non-echoing, interactive prompt to enter\r
+ passwords. Where security is truly important, use a strong\r
+ encryption method, such as AES, instead of the relatively weak\r
+ encryption provided by Traditional ZIP encryption. Or, use an\r
+ external encryption program, such as GnuPG, before archiving the\r
+ file. (Note that Zip will probably not be able to do significant\r
+ compression on a file which has already been encrypted.)\r
+3 /QUIET (-q, -qq)\r
+ /QUIET[=SUPER]\r
+\r
+ Perform operations quietly. (/QUIET=SUPER: even more quietly).\r
+\r
+ By default, UnZip prints the names of the files it's extracting or\r
+ testing, the extraction methods, any member or archive comments\r
+ that may be stored in the archive, and possibly a summary when\r
+ finished with each archive. The /QUIET[=SUPER] options suppress\r
+ the printing of some or all of these messages.\r
+3 /RESTORE (-D, -k, -ka, -X)\r
+ /RESTORE[=(keyword, ...)]\r
+\r
+ Selects restoration options for some meta-data. The optional\r
+ keywords are:\r
+\r
+ ACL Restore file ACL settings. (-ka)\r
+ OWNER Restore file owner/UIC settings. (-X)\r
+ PROTECTION = LIMITED Restore file UIC-based (SOGW) protection\r
+ settings, respecting the current default\r
+ protection. (Default.)\r
+ PROTECTION = ORIGINAL Restore file UIC-based (SOGW) protection\r
+ settings, ignoring the current default\r
+ protection. (-k)\r
+ NOPROTECTION Do not restore file UIC-based (SOGW) protection settings.\r
+ The current default protection is used. (-k-)\r
+ NODATE Do not restore any timestamps.\r
+ DATE=ALL Restore timestamps for all extracted entries,\r
+ files and directories.\r
+ DATE=FILES Restore timestamps for extracted files. (Default.)\r
+\r
+ By default, on VMS, UnZip restores the original date-time\r
+ attributes for files, but not for directories. This agrees with\r
+ the behavior of VMS BACKUP (and UnZip versions before 5.52 where\r
+ the capability to restore directory timestamps was added).\r
+\r
+ For compatibility with UnZip versions before 6.0 (5.53), the\r
+ following deprecated short forms are still accepted:\r
+\r
+ Deprecated form: Modern form:\r
+ /RESTORE /RESTORE=PROTECTION\r
+ /NORESTORE /RESTORE=NOPROTECTION\r
+3 /TEXT (-a, -aa, -S)\r
+\r
+ /TEXT[=(keyword, ...)]\r
+ /NOTEXT (Default.)\r
+\r
+ The optional keywords are:\r
+\r
+ ALL Extract all files with variable-length record format.\r
+ Adjust line endings to local standard, and convert\r
+ EBCDIC to ASCII, as needed. (-aa)\r
+ AUTO Extract text files with variable-length record format.\r
+ Adjust line endings to local standard, and convert\r
+ EBCDIC to ASCII, as needed. (Default value keyword:\r
+ "/TEXT" is equivalent to "/TEXT=AUTO".) (-a)\r
+ NONE Same as /NOTEXT. Extract text files with Stream_LF\r
+ record format without conversions. (Default\r
+ condition.)\r
+ STMLF Use Stream_LF record format for text files (instead of\r
+ variable-length record format) when ALL or AUTO is in\r
+ effect. Adjust line endings to local standard, and\r
+ convert EBCDIC to ASCII, as needed. (-S)\r
+\r
+ Selects the file record format, character encoding, and line-ending\r
+ type used when extracting text files.\r
+\r
+ Zip (or a similar archiving program) identifies files as "binary"\r
+ or "text" when they are archived. (A short-format ZipInfo report\r
+ denotes a binary file with a "b", and a text file with a "t".)\r
+ Zip's identification of text files may not be perfect, so UnZip\r
+ prints "[binary]" or "[text]" as a visual check for each file it\r
+ extracts with /TEXT. /TEXT=ALL forces all files to be extracted\r
+ (and converted) as text, regardless of the supposed file type.\r
+\r
+ [VMS] On VMS, for archives with VMS attribute information (made\r
+ with "zip -V", "ZIP /VMS"), files are always created with their\r
+ original record formats. For archives without VMS attribute\r
+ information (not made with "zip -V", "ZIP /VMS"), all files are\r
+ normally created with Stream_LF record format. With /TEXT[=AUTO],\r
+ text files are normally created with variable-length record format,\r
+ but adding STMLF gives them Stream_LF record format. Additionally,\r
+ line endings (CR, LF, CR+LF, ..) are adjusted to the local\r
+ standard, and EBCDIC is converted to ASCII. With /TEXT=ALL, all\r
+ files are treated as text files, and processed as described above.\r
+\r
+ See also /BINARY.\r
+3 /TRAVERSE_DIRS (-:)\r
+ /[NO]TRAVERSE_DIRS (Default: /NOTRAVERSE_DIRS.)\r
+\r
+ Allows UnZip to extract archive members into locations outside of\r
+ the current extraction destination directory (and its\r
+ subdirectories).\r
+\r
+ For security reasons, UnZip normally removes "parent directory"\r
+ path components ("../") from the path names of archive members as\r
+ they are extracted. This safety feature (new for version 5.50)\r
+ prevents UnZip from accidentally writing files to directories\r
+ outside the current destination directory tree. /TRAVERSE_DIRS\r
+ sets UnZip back to its previous, more liberal behavior, allowing\r
+ exact extraction of archives that use "../" path components to\r
+ create multiple directory trees at or above the level of the\r
+ destination directory.\r
+\r
+ Use this option with extreme caution.\r
+3 /UPPERCASE (-L)\r
+ /[NO]UPPERCASE\r
+\r
+ Deprecated. Use /NAMES=[NO]DOWNCASE.\r
+\r
+ /UPPERCASE: Do not convert to lowercase any filename originating\r
+ on an uppercase-only operating system or file system.\r
+\r
+ /NOUPPERCASE: Convert to lowercase any filename originating on an\r
+ uppercase-only operating system or file system.\r
+\r
+ See also /LOWERCASE, which is also deprecated.\r
+3 /VERBOSE (-v)\r
+ /VERBOSE[=(keyword, ...)]\r
+\r
+ The optional keywords are:\r
+\r
+ NORMAL Make a report more detailed/verbose. (Default value\r
+ keyword: "/VERBOSE" is equivalent to\r
+ "/VERBOSE=NORMAL".) (-v)\r
+ MORE Enable special developer I/O diagnostics. See below.\r
+ (-vv)\r
+ COMMAND Enable special developer CLI diagnostics. See below.\r
+\r
+ MORE and NORMAL may not be specified together. (MORE implies\r
+ NORMAL.)\r
+\r
+ When used with some primary mode options, /VERBOSE can make output\r
+ more detailed/verbose. See also Qualifiers_Primary_mode,\r
+ particularly /LIST.\r
+\r
+ If no other primary mode is specified, and an archive is specified,\r
+ then UnZip acts as if "/LIST /VERBOSE" were specified, and a\r
+ detailed listing is generated. See Qualifiers_Primary_mode,\r
+ particularly /LIST and /VERBOSE.\r
+\r
+ /VERBOSE=MORE ("-vv") enables some VMS-specific I/O diagnostic\r
+ messages, and is intended for use in program development, not in\r
+ normal use.\r
+\r
+ /VERBOSE=COMMAND causes UnZip to show the translated Unix-style\r
+ command-line argument vector before processing it, and is intended\r
+ for use in program development, not in normal use.\r
+ /VERBOSE=COMMAND has no Unix-style equivalent.\r
+3 /VERSION (-V)\r
+ [Non-CMS-MVS] Retain VMS file version numbers. VMS files can be\r
+ stored with a version number, in the format "file.type;##", where\r
+ "##" is a decimal number. By default the ";##" version numbers are\r
+ stripped, but this option allows them to be retained. (On file\r
+ systems that limit filenames to particularly short lengths, the\r
+ version numbers may be truncated or stripped regardless of this\r
+ option.)\r
+\r
+ [Non-VMS] Note that before UnZip version 6.10, on a non-VMS system,\r
+ a file with a name like "fred;123" would, by default, be extracted\r
+ as "fred", even if the file did not originate on a VMS system (so\r
+ that ";123" was probably not really a VMS version number).\r
+ Beginning with UnZip version 6.10, the default behavior is to strip\r
+ VMS version numbers only from files which were archived on a VMS\r
+ system. To restore the old behavior, and always strip apparent VMS\r
+ version numbers, explicitly negate the option: "-V-".\r
+3 /ZIPINFO (-Z)\r
+ ZipInfo mode. With /ZIPINFO, the program runs in ZipInfo mode,\r
+ which is used to display information about an archive and its\r
+ members. Remaining options are interpreted as ZipInfo options. If\r
+ used, /ZIPINFO must be the first qualifier on the command line.\r
+ See ZipInfo_mode.\r
+2 Environment_Options\r
+ UnZip's default behavior may be modified by placing Unix-style\r
+ command-line options in an environment variable. (The VMS CLI\r
+ translator acts only on the command line itself, not on the\r
+ environment variables.) This can be done with any option, but it is\r
+ probably most useful options like -a (/TEXT, auto-convert text\r
+ files), -L (/NAMES, downcase file names from systems with all\r
+ uppercase file names), -C (/MATCH=CASE=BLIND, use case-insensitive\r
+ name matching), -q (/QUIET, quiet), -o (/EXISTING, always\r
+ overwrite), or -n (/EXISTING, never overwrite).\r
+\r
+ For UnZip, the environment variable name on VMS is UNZIP_OPTS\r
+ (non-VMS: UNZIP). The name on VMS is different to avoid conflict\r
+ with a foreign-command DCL symbol, UNZIP. For compatibility with\r
+ Zip, if UNZIP_OPTS is not defined, then UnZip will use UNZIPOPT the\r
+ same way.\r
+\r
+ For ZipInfo ("UNZIP /ZIPINFO"), the environment variable name on\r
+ VMS is ZIPINFO_OPTS (non-VMS: ZIPINFO). For compatibility with\r
+ Zip, if ZIPINFO_OPTS is not defined, then ZipInfo will use\r
+ ZIPINFOOPT the same way.\r
+ For example, to make UnZip act as quietly as possible, only\r
+ reporting errors, one could use commands like the following (with\r
+ quotation to preserve lower case in DCL):\r
+\r
+ define UNZIP_OPTS "-q -q" ! Logical name, or\r
+ UNZIP_OPTS = "-q -q" ! DCL symbol. (Either works.)\r
+\r
+ Environment options are treated the same as any other Unix-style\r
+ command-line options, except that they are effectively the first\r
+ options on the command line. Generally, the VMS CLI translator\r
+ will override an environment option if an explicit corresponding\r
+ VMS-style qualifier is specified.\r
+\r
+ The examples show short (one-character) options, but long ("--")\r
+ options are also allowed.\r
+2 Encryption_Decryption\r
+ Zip and UnZip have long supported a relatively weak encryption\r
+ method, which we call Traditional ZIP encryption. The source code\r
+ for Traditional encryption is included in the source kits, and\r
+ support for Traditional encryption is enabled by default.\r
+ (Build-time C macro: CRYPT_TRAD.)\r
+\r
+ Beginning with UnZip version 6.10 and Zip version 3.1, these\r
+ programs also offer a stronger, Advanced Encryption Standard (AES)\r
+ encryption method, which we call AES WinZip/Gladman (AES_WG)\r
+ encryption. (The encryption code was supplied by Brian Gladman,\r
+ and the archive format is intended to be compatible with that used\r
+ by the WinZip program. WinZip is a registered trademark of WinZip\r
+ International LLC.) The source code for AES_WG encryption is\r
+ distributed in a separate kit (for export control reasons), and\r
+ support for AES_WG encryption must be enabled explicitly at build\r
+ time. (Build-time C macro: CRYPT_AES_WG.) See the INSTALL file in\r
+ the source kit for details on how to enable AES_WG encryption (or\r
+ how to disable Traditional encryption).\r
+\r
+ For details on the WinZip AES scheme, see:\r
+ http://www.winzip.com/aes_info.htm\r
+\r
+ For information on the separate AES_WG source kit, see:\r
+ ftp://ftp.info-zip.org/pub/infozip/crypt/\r
+ ftp://ftp.info-zip.org/pub/infozip/crypt/README_AES_WG.txt\r
+\r
+ Normally, encryption passwords are supplied by the user\r
+ interactively when requested by the program. See /PASSWORD for a\r
+ (less secure) method of specifying a password on the command line.\r
+\r
+ With Traditional encryption, when decrypting, a password will be\r
+ checked against header data, and used if it appears to be correct.\r
+ The correct password will always check out against the header data,\r
+ but there is a 1-in-256 chance that an incorrect password will as\r
+ well. (This is a security feature of the PKWARE archive format; it\r
+ helps prevent brute-force attacks that might otherwise gain a large\r
+ speed advantage by testing only the header.) In the case that an\r
+ incorrect password is given but it passes the header test anyway,\r
+ either an incorrect CRC will be generated for the extracted data or\r
+ else UnZip will fail during the extraction because the "decrypted"\r
+ bytes do not constitute a valid compressed data stream.\r
+\r
+ If the first password fails the header check on some file, UnZip\r
+ will prompt for another password, and so on until all files are\r
+ extracted. If a password is not known, entering a null password\r
+ (that is, just a carriage return or "Enter") is taken as a signal\r
+ to skip all further prompting. Only unencrypted files in the\r
+ archive(s) will thereafter be extracted. (The situation is\r
+ actually a little more complicated. Some old versions of Zip and\r
+ ZipCloak allowed null passwords, so UnZip checks each encrypted\r
+ file to see if the null password works. This may result in "false\r
+ positives" and extraction errors, as noted above.)\r
+\r
+ Archives encrypted with 8-bit-character passwords (for example,\r
+ passwords with accented European characters) may not be portable\r
+ across systems or to other archivers. This problem stems from the\r
+ use of multiple encoding methods for such characters, including\r
+ Latin-1 (ISO 8859-1) and OEM code page 850. DOS PKZIP 2.04g uses\r
+ the OEM code page; Windows PKZIP 2.50 uses Latin-1 (and is\r
+ therefore incompatible with DOS PKZIP; Info-ZIP uses the OEM code\r
+ page on DOS, OS/2 and Win3.x ports but ISO coding (Latin-1 etc.)\r
+ everywhere else; and Nico Mak's WinZip 6.x does not allow\r
+ 8-bit-character passwords at all. UnZip 5.3 (or newer) attempts to\r
+ use the default character set first (e.g., Latin-1), followed by\r
+ the alternate one (e.g., OEM code page) to test passwords. On\r
+ EBCDIC systems, if both of these fail, EBCDIC encoding will be\r
+ tested as a last resort. (EBCDIC is not tested on non-EBCDIC\r
+ systems, because there are no known archivers that encrypt using\r
+ EBCDIC encoding.) ISO character encodings other than Latin-1 are\r
+ not supported. The new addition of (partial) Unicode (UTF-8)\r
+ support in UnZip 6.0 has not yet been adapted to the encryption\r
+ password handling in UnZip. On systems that use UTF-8 as native\r
+ character encoding, UnZip simply tries decryption with the native\r
+ UTF-8 encoded password; the built-in attempts to check the password\r
+ in translated encoding have not yet been adapted for UTF-8 support\r
+ and will consequently fail.\r
+2 Examples\r
+ To use UnZip to extract all members of the archive letters.zip into\r
+ the current directory and subdirectories below it, creating any\r
+ subdirectories as necessary:\r
+\r
+ unzip letters\r
+\r
+ To extract all members of letters.zip into the current directory\r
+ only:\r
+\r
+ unzip /junk_dirs letters\r
+\r
+ To test letters.zip, printing only a summary message indicating\r
+ whether the archive is OK or not:\r
+\r
+ unzip /test /quiet letters\r
+\r
+ To test all ".zip" archives in the current directory, printing only\r
+ the summaries:\r
+\r
+ unzip /test /quiet *.zip\r
+\r
+ (On a Unix system, the wildcard member name would typically need to\r
+ be quoted to keep a a Unix shell from expanding ("globbing") it.\r
+ This is not necessary on VMS. However, a name with a slash ("/")\r
+ character, such as "*/zip*.*", must be quoted. Otherwise, DCL may\r
+ interpret the slash as introducing a qualifier, causing unexpected\r
+ behavior or an "%CLI-W-IVQUAL, unrecognized qualifier" error.)\r
+\r
+ The following command extracts to standard output all members of\r
+ letters.zip whose names end in ".tex", auto-converting to the local\r
+ end-of-line convention, in Stream_LF record format, and piping the\r
+ output into TYPE /PAGE:\r
+\r
+ pipe unzip /screen /text=(auto, stmlf) letters *.tex | \\r
+ type /page sys$input\r
+\r
+ To extract from source.zip all Fortran and C source files (*.f,\r
+ *.c, *.h) and Makefile into the SYS$SCRATCH directory:\r
+\r
+ unzip source.zip *.[fch] Makefile /directory = sys$scratch\r
+\r
+ To extract all FORTRAN and C source files, regardless of case (for\r
+ example, both *.c and *.C, and any makefile, Makefile, MAKEFILE or\r
+ similar):\r
+\r
+ unzip -C source.zip *.[fch] makefile /directory = sys$scratch\r
+\r
+ The following command extracts only newer versions of the files\r
+ already in the current directory, without querying. (Note: Be\r
+ careful of extracting in one timezone an archive created in\r
+ another. ZIP archives created by Zip versions before 2.1 contain\r
+ no timezone information, and a "newer" file from an eastern\r
+ timezone may, in fact, be older):\r
+\r
+ unzip /freshen /existing=new_version sources\r
+\r
+ To extract newer versions of the files already in the current\r
+ directory and to create any files not already there (same caveat as\r
+ previous example):\r
+\r
+ unzip /update /existing=new_version sources\r
+\r
+ To display a configuration report showing the program version, the\r
+ OS and compiler used to build it, a list of optional features\r
+ enabled at build time, and the values of all the relevant\r
+ environment variables:\r
+\r
+ unzip /verbose\r
+2 Exit_Status\r
+ UnZip's exit status approximates the exit codes defined by PKWARE.\r
+ On VMS, UnZip's UNIX-style exit values are translated into\r
+ VMS-style status codes with facility code 1954 = %x7A2, and with\r
+ the inhibit-message (%x10000000) and facility-specific (%x00008000)\r
+ bits set:\r
+\r
+ %x17A28001 normal exit\r
+ %x17A28000 + 16*UnZip_error_code warnings\r
+ %x17A28002 + 16*UnZip_error_code normal errors\r
+ %x17A28004 + 16*UnZip_error_code fatal errors\r
+\r
+ Note that multiplying the UNIX-style UnZip error code by 16 places\r
+ it conveniently in the hexadecimal representation of the VMS exit\r
+ code, "__" in %x17A28__s, where "s" is the severity code. For\r
+ example, a missing archive might cause UnZip error code 9, which\r
+ would be transformed into the VMS exit status %X17A28092.\r
+\r
+ The UnZip VMS exit codes include severity values which approximate\r
+ those defined by PKWARE, as shown in the following table:\r
+\r
+ VMS UnZip\r
+ severity err code Error description\r
+ ----------+----------+----------------------------------------------\r
+ Success 0 Normal. No errors or warnings detected.\r
+ Warning 1 One or more warnings were encountered, but\r
+ processing completed successfully. This\r
+ includes archives where one or more (but not\r
+ all) files were skipped because of an\r
+ unsupported compression or encryption method,\r
+ or a bad encryption password.\r
+ Error 2 Error in the archive format. Processing may\r
+ or may not have completed successfully.\r
+ Fatal 3 Severe error in the archive format.\r
+ Processing probably failed immediately.\r
+ Fatal 4 Memory allocation failed in program\r
+ initialization.\r
+ Fatal 5 Memory allocation or terminal I/O failed in\r
+ password processing.\r
+ Fatal 6 Memory allocation failed while decompressing\r
+ to disk.\r
+ Fatal 7 Memory allocation failed while decompressing\r
+ in memory.\r
+ Fatal 8 Memory allocation failed. (Currently not\r
+ used.)\r
+ Error 9 Specified archive files were not found.\r
+ Error 10 Invalid command-line options or parameters.\r
+ Error 11 No matching files were found.\r
+ Fatal 50 Disk (file system) filled during extraction.\r
+ Fatal 51 Unexpected end-of-file while reading the\r
+ archive.\r
+ Error 80 User interrupt (Ctrl/C).\r
+ Error 81 No files were processed, because of\r
+ unsupported compression or encryption\r
+ methods.\r
+ Error 82 No files were processed, because of bad\r
+ encryption password(s).\r
+ Fatal 83 Large-file archive could not be processed by\r
+ this small-file program.\r
+2 Bugs\r
+ Multi-part archives are not yet supported, except in conjunction\r
+ with Zip. (All parts must be concatenated together in order, and\r
+ then "zip -F" (for Zip 2.x) or "zip -FF" (for Zip 3.x) must be\r
+ performed on the concatenated archive in order to "fix" it. Also,\r
+ zip 3.0 and later can combine multi-part (split) archives into a\r
+ combined single-file archive using "zip -s- inarchive -O\r
+ outarchive". See the zip manual page for more information.) This\r
+ may be corrected in the next major release.\r
+\r
+ Archives read from standard input are not yet supported, except\r
+ with UnZip (and then only the first member of the archive can be\r
+ extracted).\r
+\r
+ Archives encrypted with 8-bit-character passwords (such as\r
+ passwords with accented European characters) may not be portable\r
+ across systems and/or other archivers. See also\r
+ Encryption_Decryption.\r
+\r
+ UnZip's -M ("--more") option tries to take into account automatic\r
+ wrapping of long lines. However, the code may fail to detect the\r
+ correct wrapping locations. First, TAB characters (and similar\r
+ control sequences) are not taken into account, they are handled as\r
+ ordinary printable characters. Second, depending on the actual\r
+ system type, UnZip may not detect the true terminal/emulator\r
+ geometry, but instead may rely on "commonly used" default\r
+ dimensions. The correct handling of tabs would require the\r
+ implementation of a query for the actual tab setup on the output\r
+ terminal/emulator.\r
+\r
+ [Unix] Unix special files such as FIFO buffers (named pipes), block\r
+ devices and character devices are not restored even if they are\r
+ somehow represented in the archive, nor are hard-linked files\r
+ relinked. Basically, the only file types restored by UnZip are\r
+ regular files, directories, and symbolic (soft) links.\r
+\r
+ [OS/2] Extended attributes for existing directories are only\r
+ updated if the -o ("--overwrite") option is given. This is a\r
+ limitation of the operating system; because directories only have a\r
+ creation time associated with them, UnZip has no way to determine\r
+ whether the stored attributes are newer or older than those on\r
+ disk. In practice this may mean a two-pass approach is required:\r
+ first unpack the archive normally (with or without\r
+ freshening/updating existing files), then overwrite just the\r
+ directory entries (for example, "unzip -o foo */").\r
+2 URL\r
+ The Info-ZIP main Web page is:\r
+ http://www.info-zip.org/\r
+\r
+ FTP access is available, too:\r
+ ftp://ftp.info-zip.org/pub/infozip/\r
+2 ZipInfo_mode\r
+ When /ZIPINFO is specified, the program runs in ZipInfo mode.\r
+ Remaining options are interpreted as ZipInfo options. If used,\r
+ /ZIPINFO must be the first qualifier on the command line.\r
+\r
+ ZipInfo reports detailed information about a ZIP archive and its\r
+ members. This information may include file access permissions,\r
+ compression method, encryption method, version and operating system\r
+ (or file system) of the archive-creating program, and so on. The\r
+ default behavior (with no options) is to show a single-line entry\r
+ for each member in the archive, with a header and a trailer\r
+ providing summary information for the entire archive. The format\r
+ is a cross between Unix "ls -l" and "UNZIP /LIST /VERBOSE" output.\r
+ See Detailed_Description. ZipInfo is the same program as UnZip.\r
+ (On Unix, "zipinfo" may be a link to "unzip". On VMS, "ZIPINFO" is\r
+ normally a DCL symbol defined as "''UNZIP' /ZIPINFO".) However,\r
+ ZipInfo support may have been disabled when UnZip was built.\r
+\r
+ Format:\r
+\r
+ ZIPINFO [/zipinfo_options] [file[.zip]] [member [,...]]\r
+\r
+ UNZIP /ZIPINFO [/zipinfo_options] [file[.zip]] [member [,...]]\r
+3 Command_Parameters\r
+ file[.zip]\r
+\r
+ File path/name of a ZIP archive. A wildcard name may be used to\r
+ specify multiple ZIP archives to be processed in one command.\r
+ On VMS systems, any of the standard wildcards for a\r
+ directory/file specification may be used: "...", "*", or "%"\r
+ (or, since VMS V7.2, "?"). The default archive file\r
+ specification is ".ZIP".\r
+\r
+ Note that a ".zip" or ".ZIP" file type on an archive is merely a\r
+ convention, not a requirement. For example, a self-extracting\r
+ ZIP archive named "fred" or "fred.exe" could be processed as if\r
+ it were an ordinary archive; just specify the actual file name\r
+ with its actual name ending (if any), whatever that may be.\r
+\r
+ member [,...]\r
+\r
+ An optional list of archive members to be processed, separated\r
+ by commas. If no member list is specified, then all archive\r
+ members are processed. Unix-like ("globbing") wildcard patterns\r
+ may be used to match multiple members:\r
+\r
+ * Matches a sequence of 0 or more characters.\r
+ ? Matches exactly 1 character.\r
+ [...] Matches any single character found inside the\r
+ brackets. Ranges are specified by a beginning\r
+ character, a hyphen, and an ending character. If an\r
+ exclamation point ("!") or a caret ("^") follows the\r
+ left bracket, then the range of characters within\r
+ the brackets is complemented. That is, anything\r
+ except the characters inside the brackets is\r
+ considered a match. To specify a literal left\r
+ bracket, use the three-character sequence "[[]".\r
+3 Qualifiers_Primary_Format\r
+ Qualifiers in this group specify the primary report format of\r
+ ZipInfo. Only one of these primary format qualifiers may be\r
+ specified.\r
+4 /LONG (-l)\r
+ Primary Format. Show member info in long Unix "ls -l" format.\r
+ Like the /MEDIUM format, except that the compressed size (in bytes)\r
+ is printed instead of the compression ratio.\r
+4 /ONE_LINE (-2)\r
+ Primary Format. Show member names only, one per line. Other\r
+ report elements are allowed, if requested explicitly using /HEADER,\r
+ /TOTALS, and/or /COMMENT.\r
+4 /MEDIUM (-m)\r
+ Primary Format. Show member info in medium-length Unix "ls -l"\r
+ format. Like the /SHORT format, except that the compression\r
+ factor, expressed as a percentage, is also included.\r
+4 /SHORT (-s)\r
+ Primary Format. Show member info in short Unix "ls -l" format.\r
+ This is the default behavior, unless /HEADER or /TOTALS is\r
+ specified.\r
+4 /VERBOSE (-v)\r
+ Primary Format. The ZipInfo /VERBOSE report is very detailed, and\r
+ mostly self-explanatory, but it does assume some familiarity with\r
+ the ZIP archive format. It also includes the archive comment, if\r
+ any. Extra fields in the central directory are broken down into\r
+ subfields, with brief interpretations of recognized subfields (or\r
+ abbreviated dumps of unrecognized subfields).\r
+3 Qualifiers_Ordinary\r
+ Qualifiers in this group modify the operation or report format of\r
+ ZipInfo.\r
+4 /COMMENT (-z)\r
+ Include the archive comments (if any) in the report.\r
+4 /DECIMAL_TIME (-T)\r
+ Show the file date-times in a sortable, all-numeric,\r
+ "YYYYMMDD.hhmmss" format. The default date format is an\r
+ alpha-numeric "YY-Mmm-DD hh:mm". For example ("/SHORT", "/SHORT\r
+ /DECIMAL_TIME"):\r
+\r
+ -rw-a-- 3.1 fat 211916 tx defX 10-Jun-18 00:27 zip31c/zip.c\r
+ -rw-a-- 3.1 fat 211916 tx defX 20100618.002703 zip31c/zip.c\r
+4 /EXCLUDE (-x)\r
+ /EXCLUDE=(member [,...])\r
+ An optional list of archive members to be excluded from processing.\r
+ Because wildcard characters normally match "/" directory separators\r
+ (for exceptions see /WILD_SPAN (-W)), this option may be used to\r
+ exclude any files that are in subdirectories. For example,\r
+ UNZIP foo *.[ch] /EXCLUDE = */*\r
+ would extract all C source files (*.c, *.h) in the main directory,\r
+ but none in any subdirectories. Without the /EXCLUDE option, all C\r
+ source files in all directories within the archive would be\r
+ extracted.\r
+\r
+ Note that archive members are specified using the Unix-style names\r
+ which are used in ZIP archives, not VMS-style names.\r
+4 /HEADER (-h)\r
+ Include a header in the report, showing the archive name, the\r
+ archive size (in bytes), and the number of members in the archive.\r
+\r
+ For the Unix-format reports (options /LONG, /MEDIUM, /SHORT), the\r
+ header is included by default, if no archive members are specified.\r
+ If /HEADER is specified alone, that is, without one of the\r
+ Unix-format options, and without a member list, then only the\r
+ header lines will be put out.\r
+3 /MATCH (-C, -W)\r
+ /MATCH=(keyword, ...)\r
+\r
+ Specifies name-matching behavior for names in the member list and\r
+ the /EXCLUDE excluded-member list on the command line.\r
+\r
+ The optional keywords and values are:\r
+\r
+ CASE=BLIND Name matching is case-insensitive. (-C)\r
+ CASE=SENSITIVE Name matching is case-sensitive. (Default.)\r
+\r
+ By default, case-sensitive matching is done. For example,\r
+ specifying "makefile" on the command line will match only\r
+ "makefile" in the archive, not "Makefile" or "MAKEFILE". On many\r
+ systems, the local file system is case-insensitive, so\r
+ case-insensitive name matching would be more natural. With\r
+ /MATCH=CASE=BLIND, "makefile" would match "makefile", "Makefile",\r
+ or "MAKEFILE".\r
+\r
+ /MATCH does not affect the search for the ZIP archive file(s), nor\r
+ the matching of archive members to existing files on the extraction\r
+ path. So, on a case-sensitive file system, UnZip will never try to\r
+ overwrite a file "FOO" when extracting a member named "foo"!\r
+\r
+ [WILD_STOP_AT_DIR] If the C macro WILD_STOP_AT_DIR is defined at\r
+ build time, then an additional keyword is allowed:\r
+\r
+ NOWILD_MATCH_SLASH Wildcards stop at directory slash. (-W)\r
+ WILD_MATCH_SLASH Wildcards match directory slash. (Default.)\r
+\r
+ By default, the wildcard characters "?" (single-character wildcard)\r
+ and "*" (multi-character wildcard) match any character in a member\r
+ path/name. /MATCH=NOWILD_MATCH_SLASH (-W) modifies the\r
+ pattern-matching behavior for archive members so that both "?"\r
+ (single-character wildcard) and "*" (multi-character wildcard) do\r
+ not match the directory separator character "/". (The\r
+ two-character sequence "**" acts as a multi-character wildcard that\r
+ includes the directory separator in its matched characters.) For\r
+ example, with /MATCH=NOWILD_MATCH_SLASH:\r
+ "*.c" matches "foo.c" but not "mydir/foo.c"\r
+ "**.c" matches both "foo.c" and "mydir/foo.c"\r
+ "*/*.c" matches "bar/foo.c" but not "baz/bar/foo.c"\r
+ "??*/*" matches "ab/foo" and "abc/foo"\r
+ but not "a/foo" or "a/b/foo"\r
+\r
+ This modified behavior is equivalent to the pattern matching style\r
+ used by the shells of some of \fIUnZip\fP's supported target OSs\r
+ (one example is Acorn RISC OS). This option may not be available\r
+ on systems where the Zip archive's internal directory separator\r
+ character "/" is allowed as regular character in native operating\r
+ system filenames.\r
+\r
+ [non-VMS] (Currently, UnZip uses the same pattern matching rules\r
+ for both wildcard archive file name specifications and archive\r
+ member selection patterns on most system types. For systems\r
+ allowing "/" as regular filename character, the -W option would not\r
+ work as expected on a wildcard file name specification.)\r
+4 /MEMBER_COUNTS (default) (-mc)\r
+ /NOMEMBER_COUNTS\r
+ Control inclusion of separate member counts for directories, files,\r
+ and (if symlinks are supported) links, after the totals summary at\r
+ the end of the report. By default, they are included. Use\r
+ /NOMEMBER_COUNTS" to suppress them. See also /TOTALS.\r
+4 /PAGE (-M)\r
+ Pipe all output through an internal pager similar to the Unix\r
+ more(1) command. At the end of a screenful of output, UnZip pauses\r
+ with a "--More--" prompt; the next screenful may be viewed by\r
+ pressing the Enter (Return) key or the space bar. UnZip can be\r
+ terminated by pressing the "Q" key and, on some systems, the\r
+ Enter/Return key. Unlike Unix more(1), there is no\r
+ forward-searching or editing capability. Also, UnZip doesn't\r
+ notice if long lines wrap at the edge of the screen, effectively\r
+ resulting in the printing of two or more lines and the likelihood\r
+ that some text will scroll off the top of the screen before being\r
+ viewed. If the actual number of lines on the screen can not be\r
+ determined, 24 lines will be assumed.\r
+4 /TOTALS (-t)\r
+ Include a totals summary at the end of the report, showing the\r
+ number of members in the report, the sum of their uncompressed\r
+ sizes, the sum of their compressed sizes, and the compression\r
+ factor as a percentage.\r
+\r
+ For the Unix-format reports (/LONG, /MEDIUM, /SHORT), the totals\r
+ summary is included by default, if no archive members are\r
+ specified. If /TOTALS is specified alone, that is, without one of\r
+ the Unix-format options, and without a member list, then only the\r
+ totals summary trailer lines will be put out.\r
+\r
+ The total "bytes compressed" reported includes only the actual\r
+ data, not the ZIP archive meta-data, so the size of the archive\r
+ will always be greater than this value.\r
+\r
+ See also /MEMBER_COUNTS.\r
+3 Detailed_Description\r
+ ZipInfo has three basic report formats, providing different degrees\r
+ of detail in the information about the members of an archive: a\r
+ simple list of names (/ONE_LINE (-1, -2)), a Unix ls-style listing\r
+ (/LONG (-l), /MEDIUM (-m), /SHORT (-s)), and a very detailed\r
+ analysis (/VERBOSE (-v)). Some of the information, such as file\r
+ sizes, is easy to interpret. Some of the information involves\r
+ fairly obscure details of ZIP archive structure. ZIP archive\r
+ structure is documented in the PKWARE Inc. APPNOTE.TXT:\r
+ http://www.pkware.com/documents/casestudies/APPNOTE.TXT\r
+\r
+ The table below shows some typical /LONG report entries:\r
+\r
+ Perm/Prot Zver Ofs UncSize At CmpSize Cmth ModDate Mtime Name\r
+ ----------+----+---+-------+--+-------+----+---------------+----------\r
+ -rw-a-- 3.1 fat 211916 tx 53467 defX 10-Jun-18 00:27 zip3/zip.c\r
+ -rwxr-x--- 3.1 unx 709 Tx 311 aesw 11-Aug-21 22:20 endian.c\r
+ RWED,RE, 3.1 vms 6656 bx 2295 defN 07-Aug-15 14:12 it/T.EXE;8\r
+\r
+ Field 1 (Perm/Prot) shows the file permission/protection\r
+ attributes, formatted according to the original operating system or\r
+ file system where the archive was created.\r
+\r
+ Field 2 (Zver) shows the (approximate) version of the Zip program\r
+ which created the archive.\r
+\r
+ Field 3 (Ofs) shows the original operating system where the archive\r
+ was created, or the file system on which the member file was\r
+ stored.\r
+\r
+ Field 4 (UncSize) shows the original, uncompressed file size.\r
+\r
+ Field 5 (At) shows some archive member attributes, as detailed in\r
+ the tables below. The first character indicates whether a file was\r
+ binary or text, and whether it was encrypted. The second character\r
+ indicates the presence of a data descriptor and/or an extra field\r
+ in the member data.\r
+\r
+ | File Type Extra Field |\r
+ First char | binary text yes no | Second char\r
+ --------------+-------+----- ------+-----+--------------------\r
+ Encrypted no | b t x - | no Data Descriptor\r
+ yes | B T X l | yes\r
+\r
+ A Data Descriptor holds CRC and size data at an alternate place in\r
+ the archive (after processed member data instead of before), and is\r
+ normally used when the archiving program can't seek in the output\r
+ archive data/file. An Extra Field can hold a wide variety of data,\r
+ including 64-bit file sizes, many kinds of OS-specific attribute\r
+ data, UTC times, and so on.\r
+\r
+ Field 6 (CmpSize) shows the compressed file size. With /MEDIUM,\r
+ this field shows the compression fraction as a percentage. With\r
+ /SHORT (the default), this field is omitted. This compressed size\r
+ value (unlike the one in an "UNZIP /LIST" report) includes all the\r
+ overhead resulting from Traditional encryption.\r
+\r
+ Field 7 (Cmth) shows the compression method used. Note that AES_WG\r
+ encryption is treated as a compression method here. Not all of the\r
+ methods shown in the table below are supported. (Some are\r
+ obsolete.)\r
+\r
+ Num Abbr Name, description\r
+ ----+----+------------------------------------------------------------\r
+ 0 stor Store (no compression)\r
+ 1 shrk Shrink\r
+ 2 re:1 Reduce (factor 1)\r
+ 3 re:2 Reduce (factor 2)\r
+ 4 re:3 Reduce (factor 3)\r
+ 5 re:4 Reduce (factor 4)\r
+ 6 i#:# Implode (dictonary_size:Shannon-Fano_trees)\r
+ 7 tokn Tokenize\r
+ 8 def# Deflate (N: normal, X: maximum, F: fast, S: super-fast)\r
+ 9 d64# Deflate64 (N: normal, X: maximum, F: fast, S: super-fast)\r
+ 10 dcli PKWARE Data Compression Library Imploding - IBM TERSE (old)\r
+ 12 bzp2 bzip2\r
+ 14 lzma LZMA\r
+ 18 ters IBM TERSE (new)\r
+ 19 lz77 IBM LZ77 z Architecture (PFS)\r
+ 96 jpeg JPEG\r
+ 97 wavp WavPack\r
+ 98 ppmd PPMd version I, Rev 1\r
+ 99 aesw AES_WG encryption\r
+\r
+ Fields 8 and 9 (ModDate, Mtime) show the file modification\r
+ date-time (MS-DOS format, local time).\r
+\r
+ Field 10 (Name) shows the file path/name.\r
+3 Environment_Options\r
+ ZipInfo's default behavior may be modified by placing Unix-style\r
+ command-line options in an environment variable. (The VMS CLI\r
+ translator acts only on the command line itself, not on the\r
+ environment variables.) This can be done with any option, but it is\r
+ probably most useful options like -T (/DECIMAL_TIME, decimal time\r
+ format) or one of the non-default Unix format options: -l (/LONG),\r
+ -m (/MEDIUM).\r
+\r
+ For ZipInfo ("UNZIP /ZIPINFO", ZIPINFO), the environment variable\r
+ name on VMS is ZIPINFO_OPTS (non-VMS: ZIPINFO). For compatibility\r
+ with Zip, if ZIPINFO (ZIPINFO_OPTS on VMS) is not defined, then\r
+ ZipInfo will use ZIPINFOOPT the same way.\r
+\r
+ For example, to make the default format the long Unix format\r
+ instead of the short Unix format, one could use commands like the\r
+ following (with quotation to preserve lower case in DCL):\r
+\r
+ define ZIPINFO_OPTS "-l" ! Logical name, or\r
+ ZIPINFO_OPTS = "-l" ! DCL symbol. (Either works.)\r
+\r
+ Environment options are treated the same as any other Unix-style\r
+ command-line options, except that they are effectively the first\r
+ options on the command line. Generally, the VMS CLI translator\r
+ will override an environment option if an explicit corresponding\r
+ VMS-style qualifier is specified.\r
+\r
+ The examples show short (one-character) options, but long ("--")\r
+ options are also allowed.\r
+3 Examples\r
+ To get a basic, short-format listing of the complete contents of a\r
+ ZIP archive zip31c.zip, with both header and totals lines, use only\r
+ the archive name as an argument to zipinfo:\r
+\r
+ zipinfo zip31c.zip\r
+ zipinfo zip31c\r
+\r
+ To produce a basic, long-format listing (not verbose), including\r
+ header and totals lines, use /LONG:\r
+\r
+ zipinfo /long zip31c.zip\r
+\r
+ To list the complete contents of the archive without header and\r
+ totals lines, either negate the /HEADER and /TOTALS qualifiers or\r
+ else specify the contents explicitly:\r
+\r
+ zipinfo /noheader /nototals zip31c.zip\r
+ zipinfo zip31c.zip *\r
+\r
+ (On a Unix system, the wildcard member name would typically need to\r
+ be quoted to keep a a Unix shell from expanding ("globbing") it.\r
+ This is not necessary on VMS. However, a name with a slash ("/")\r
+ character, such as "*/zip*.*", must be quoted. Otherwise, DCL may\r
+ interpret the slash as introducing a qualifier, causing unexpected\r
+ behavior or an "%CLI-W-IVQUAL, unrecognized qualifier" error.)\r
+\r
+ To list information on a single archive member, in medium format,\r
+ specify the member name explicitly:\r
+\r
+ zipinfo /medium unzip60.zip */unshrink.c\r
+\r
+ On a VMS system, one could use /DECIMAL_TIME along with an external\r
+ sorting program to get a listing of files in the archive in\r
+ date-time order:\r
+\r
+ pipe zipinfo /decimal_time /long /noheader /nototals zip31c.zip | -\r
+ sort sys$input sys$output /key = (position:47, size:15, descend)\r
+\r
+ For a /LONG (-l) format report, the date-time field should begin at\r
+ position 47; for /MEDIUM (-m), 42; for /SHORT (-s), 38. HELP SORT\r
+ [/KEY] should lead to an explanation of the various SORT options.\r
+ (Unlike Unix, VMS does not include a useful "head" or "tail"\r
+ program.)\r
+\r
+ On a Unix system, one could use the -T option along with an\r
+ external sorting program (and another filter like "head" or "tail")\r
+ to get a listing of the least or most recently modified files in\r
+ the archive:\r
+\r
+ zipinfo -l -T -h- -t- zip31c.zip | sort -k 8 | head -12\r
+ zipinfo -l -T -h- -t- zip31c.zip | sort -r -k 8 | head -12\r
+\r
+ The "sort" option "-k 8" tells it to sort on field 8, which is the\r
+ date-time field in a long- or medium-format (-l, -m) ZipInfo\r
+ report. (Use "-k 7" for the short (-s) format.) The -r option\r
+ reverses the default smallest-to-largest sort order.\r
+3 Bugs\r
+ As with UnZip, ZipInfo's /PAGE (-M) option is overly simplistic in\r
+ its handling of screen output. As noted above, it fails to detect\r
+ the wrapping of long lines and may thereby cause lines at the top\r
+ of the screen to be scrolled off before being read. ZipInfo should\r
+ detect and treat each occurrence of line-wrap as one additional\r
+ line printed. This requires knowledge of the screen's width as\r
+ well as its height. In addition, ZipInfo should detect the true\r
+ screen geometry on all systems.\r
+\r
+ The interactions among the various listing format, header, and\r
+ trailer options (/HEADER, /LONG, /MEDIUM, /SHORT, /TOTALS) are\r
+ unnecessarily complex and should be simplified, despite the\r
+ potential disruption to current users.\r
+3 URL\r
+ The Info-ZIP main Web page is:\r
+ http://www.info-zip.org/\r
+\r
+ FTP access is available, too:\r
+ ftp://ftp.info-zip.org/pub/infozip/\r
ZCONST char Far CentSigMsg[] =
"error: expected central file header signature not found (file #%lu).\n";
ZCONST char Far SeekMsg[] =
- "error [%s]: attempt to seek before beginning of zipfile\n%s";
+ "error [%s]: attempt to seek before beginning of zipfile (%d)\n%s";
ZCONST char Far FilenameNotMatched[] = "caution: filename not matched: %s\n";
ZCONST char Far ExclFilenameNotMatched[] =
"caution: excluded filename not matched: %s\n";
conflict_queryw()
set_dir_attribs() SET_DIR_ATTRIB
extract_or_test_stream() Entry - stream
+ close_segment()
find_local_header()
central_local_name_check()
extract_or_test_entrylist()
#endif /* def ARCHIVE_STDIN */
+/*******************************/
+/* Function close_segment(). */
+/*******************************/
+static void close_segment(__G)
+{
+ if (G.zipfn_sgmnt != NULL)
+ {
+ izu_free(G.zipfn_sgmnt);
+ G.zipfn_sgmnt = NULL;
+ }
+ CLOSE_INFILE( &G.zipfd_sgmnt);
+
+} /* close_segment(). */
+
+
/**********************************/
/* Function find_local_header() */
/**********************************/
* (either haven't yet read far enough, or (maybe) skipping backward),
* then skip to the target position and reset readbuf().
*/
+ /*if(G.ecrec.number_this_disk != G.pInfo->diskstart) {*/
+ if (G.ecrec.number_this_disk > 0)
+ {
+ /* Open file (when it is segmented) even if it is a duplicate
+ * of the same fd, due to possible unwanted changes of G.zipfd
+ * and G.sgmnt_nr which were saved in extract_or_test_files().
+ */
+ if (!fd_is_valid(G.zipfd_sgmnt) || G.sgmnt_nr != G.pInfo->diskstart)
+ {
+ if (fd_is_valid(G.zipfd_sgmnt))
+ close_segment(); /* We need a different file. */
+
+ set_zipfn_sgmnt_name(G.pInfo->diskstart);
+ if (open_infile( __G__ OIF_SEGMENT))
+ {
+ /* TODO: ask for place/path of zipfile, see wild*!, ... */
+ /* Create new function for this all? */
+ izu_free(G.zipfn_sgmnt);
+ G.zipfn_sgmnt = NULL;
+ error = PK_NOZIP;
+ return error;
+ }
+ else
+ {
+ /* TODO: that's not best solution but for
+ * testing/alpha version is good enough now. */
+ G.zipfd = G.zipfd_sgmnt;
+ G.sgmnt_nr = G.pInfo->diskstart;
+ }
+ /* When we change file, we must refill buffer always!
+ * (Same method as in seek_zipf().)
+ */
+ G.cur_zipfile_bufstart = -1;
+ }
+ /* TODO: check better too -- Is G.extra_bytes important in
+ * segmented? Otherwise bigger harakiri is here
+ * needed (here = whole request block below)
+ */
+ request = G.pInfo->offset;
+ }
+ else
+ {
+ request = G.pInfo->offset + G.extra_bytes;
+ }
+
/* seek_zipf(__G__ pInfo->offset); */
- request = G.pInfo->offset + G.extra_bytes;
+ /* TODO: this code must be checked / verified better by someone else!
+ * I'm not sure about impact of changes what are here done for
+ * multi-disk support.
+ */
inbuf_offset = request % INBUFSIZ;
bufstart = request - inbuf_offset;
if (request < 0)
{
Info(slide, 0x401, ((char *)slide, LoadFarStringSmall(SeekMsg),
- G.zipfn, LoadFarString(ReportMsg)));
+ 1, G.zipfn, LoadFarString(ReportMsg)));
*perr_in_arch = PK_ERR;
if (filnum == 1 && G.extra_bytes != 0L)
{
#ifdef DLL
if ((G.statreportcb != NULL) &&
- (*G.statreportcb)(__G__ UZ_ST_START_EXTRACT, G.zipfn,
- G.filename, NULL)) {
- return IZ_CTRLC; /* cancel operation by user request */
+ (*G.statreportcb)(__G__ UZ_ST_START_EXTRACT, G.zipfn,
+ G.filename, NULL))
+ {
+ close_segment();
+ return IZ_CTRLC; /* Cancel operation by user request. */
}
#endif
#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */
#endif
G.disk_full = 0;
- if ((error = extract_or_test_member(__G)) != PK_COOL) {
+ if ((error = extract_or_test_member(__G)) != PK_COOL)
+ {
if (error > error_in_archive)
error_in_archive = error; /* ...and keep going */
+
+ if ((G.disk_full > 1)
#ifdef DLL
- if (G.disk_full > 1 || error_in_archive == IZ_CTRLC) {
-#else
- if (G.disk_full > 1) {
+ || (error_in_archive == IZ_CTRLC)
#endif
- return error_in_archive; /* (unless disk full) */
+ )
+ {
+ close_segment();
+ return error_in_archive; /* (unless disk full) */
}
}
#ifdef DLL
if ((G.statreportcb != NULL) &&
- (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn,
- G.filename, (zvoid *)&G.lrec.ucsize)) {
- return IZ_CTRLC; /* cancel operation by user request */
+ (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn,
+ G.filename, (zvoid *)&G.lrec.ucsize))
+ {
+ close_segment();
+ return IZ_CTRLC; /* Cancel operation by user request. */
}
#endif
#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */
#endif
} /* end for-loop (i: files in current block) */
+ close_segment();
return error_in_archive;
} /* extract_or_test_entrylist(). */
# ifdef DLL
if ((G.statreportcb != NULL) &&
(*G.statreportcb)(__G__ UZ_ST_START_EXTRACT, G.zipfn,
- G.filename, NULL)) {
- return IZ_CTRLC; /* cancel operation by user request */
+ G.filename, NULL))
+ {
+ close_segment();
+ return IZ_CTRLC; /* Cancel operation by user request. */
}
# endif
if ((error = extract_or_test_member(__G)) != PK_COOL) {
if (error > error_in_archive)
error_in_archive = error; /* ...and keep going */
+
+ if ((G.disk_full > 1)
# ifdef DLL
- if (G.disk_full > 1 || error_in_archive == IZ_CTRLC) {
-# else
- if (G.disk_full > 1) {
+ || (error_in_archive == IZ_CTRLC)
# endif
- return error_in_archive; /* (unless disk full) */
+ )
+ {
+ close_segment();
+ return error_in_archive; /* (unless disk full) */
}
}
# ifdef DLL
if ((G.statreportcb != NULL) &&
- (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn,
- G.filename, (zvoid *)&G.lrec.ucsize)) {
- return IZ_CTRLC; /* cancel operation by user request */
+ (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn,
+ G.filename, (zvoid *)&G.lrec.ucsize))
+ {
+ close_segment();
+ return IZ_CTRLC; /* Cancel operation by user request. */
}
# endif
} /* end for-loop (i: files in current block) */
+ close_segment();
return error_in_archive;
} /* extract_or_test_entrylistw(). */
ulg blknum = 0L;
int reached_end;
int sts;
+ zuvl_t sgmnt_nr;
+ zipfd_t zipfd;
#ifndef SFX
int no_endsig_found;
#endif
cd_inptr = G.inptr;
cd_incnt = G.incnt;
+ /* Save the file descr/pointer and segment number, which are subject
+ * to change when the archive is segmented.
+ */
+ zipfd = G.zipfd;
+ sgmnt_nr = G.sgmnt_nr;
+
/*-----------------------------------------------------------------------
Second loop: process files in current block, extracting or testing
each one.
#endif
error_in_archive);
}
+ /* Restore the file descr/pointer and segment number. */
+ G.zipfd = zipfd;
+ G.sgmnt_nr = sgmnt_nr;
+
if (error != PK_COOL) {
if (error > error_in_archive)
error_in_archive = error;
/*
- Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
+ Copyright (c) 1990-2015 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2009-Jan-02 or later
(the contents of which are also included in unzip.h) for terms of use.
static ZCONST char Far CannotOpenZipfile[] =
"error: cannot open zipfile [ %s ]\n %s\n";
+static ZCONST char Far NoSuchSegment[] =
+ "Bad archive segment value (%d > %d)";
+
#if !defined(VMS) && !defined(AOS_VS) && !defined(CMS_MVS) && !defined(MACOS)
# ifndef TANDEM
# if defined(ATH_BEO_THS_UNX) || defined(DOS_FLX_NLM_OS2_W32)
-/******************************/
-/* Function open_input_file() */
-/******************************/
-
-int open_input_file(__G) /* return 1 if open failed */
- __GDEF
+/**************************/
+/* Function open_infile() */
+/**************************/
+int open_infile(__G__ which)
+ __GDEF
+ int which; /* 0: Primary archive; 1: Segment archive. */
{
- /*
- * open the zipfile for reading and in BINARY mode to prevent cr/lf
- * translation, which would corrupt the bitstreams
- */
+ /* Open an archive (zipfile) for reading and in BINARY mode to
+ * prevent CR/LF translation, which would corrupt the data.
+ * Return 0: success; 1: failure.
+ */
+
+ char *fn;
+ zipfd_t *pfd;
+
+ if (which == OIF_PRIMARY)
+ {
+ fn = G.zipfn; /* Primary archive file name (".zip"). */
+ pfd = &G.zipfd; /* Primary archive file descr/pointer. */
+ }
+ else
+ {
+ fn = G.zipfn_sgmnt; /* Segment archive file name (".zXX"). */
+ pfd = &G.zipfd_sgmnt; /* Segment archive file descr/pointer. */
+ }
#ifdef VMS
- G.zipfd = open(G.zipfn, O_RDONLY, 0, OPNZIP_RMS_ARGS);
+ *pfd = open( fn, O_RDONLY, 0, OPNZIP_RMS_ARGS);
#else /* def VMS */
# ifdef MACOS
- G.zipfd = open(G.zipfn, 0);
+ *pfd = open( fn, 0);
# else /* def MACOS */
# ifdef CMS_MVS
- G.zipfd = vmmvs_open_infile(__G);
+ *pfd = vmmvs_open_infile(__G fn, pfd);
# else /* def CMS_MVS */
if (G.zipstdin)
{
/* Archive is stdin. No need to open it. */
# ifdef USE_STRM_INPUT
- G.zipfd = stdin;
+ *pfd = stdin;
# else /* def USE_STRM_INPUT */
- G.zipfd = STDIN_FILENO;
+ *pfd = STDIN_FILENO;
# endif /* def USE_STRM_INPUT */
}
else
{
/* Archive is plain file (we hope). */
# ifdef USE_STRM_INPUT
- G.zipfd = fopen(G.zipfn, FOPR);
+ *pfd = fopen( fn, FOPR);
# else /* def USE_STRM_INPUT */
- G.zipfd = open(G.zipfn, O_RDONLY | O_BINARY);
+ *pfd = open( fn, O_RDONLY | O_BINARY);
# endif /* def USE_STRM_INPUT */
}
# endif /* def CMS_MVS [else] */
# endif /* def MACOS [else] */
#endif /* def VMS [else] */
+ if (!fd_is_valid( *pfd))
+ {
+ Info(slide, 0x401, ((char *)slide, LoadFarString(CannotOpenZipfile),
+ fn, strerror(errno)));
+ return 1;
+ }
+ return 0;
+
+} /* open_infile(). */
+
+
+/***************************/
+/* Function close_infile() */
+/***************************/
+int close_infile( __G__ pfd)
+ __GDEF
+ zipfd_t *pfd;
+{
+ int sts;
+
+ if (fd_is_valid( *pfd))
+ {
#ifdef USE_STRM_INPUT
- if (G.zipfd == NULL)
+ sts = fclose( *pfd);
+ *pfd = NULL;
#else /* def USE_STRM_INPUT */
- /* if (G.zipfd < 0) */ /* no good for Windows CE port */
- if (G.zipfd == -1)
+ sts = close( *pfd);
+ *pfd = -1;
#endif /* def USE_STRM_INPUT [else] */
+ }
+
+ return sts;
+} /* close_infile(). */
+
+
+/***********************************/
+/* Function set_zipfn_sgmnt_name() */
+/***********************************/
+int set_zipfn_sgmnt_name( __G__ sgmnt_nr)
+ __GDEF
+ zuvl_t sgmnt_nr;
+{
+ char *suffix;
+ int sufx_len;
+
+/* sizeof( ".z65535") == 8 should be safe. */
+#define SGMNT_NAME_BOOST 8
+
+ if (sgmnt_nr > G.ecrec.number_this_disk)
+ {
+ /* Segment number greater than (max?) central-dir disk number. */
+ Info(slide, 1, ((char *)slide, LoadFarString(NoSuchSegment),
+ sgmnt_nr, G.ecrec.number_this_disk));
+ return 1;
+ }
+
+ if (G.zipfn_sgmnt == NULL)
+ {
+ G.zipfn_sgmnt_size = strlen(G.zipfn)+ SGMNT_NAME_BOOST;
+ if ((G.zipfn_sgmnt = izu_malloc(G.zipfn_sgmnt_size)) == NULL)
{
- Info(slide, 0x401, ((char *)slide, LoadFarString(CannotOpenZipfile),
- G.zipfn, strerror(errno)));
+ G.zipfn_sgmnt_size = -1;
+ return 1;
+ }
+ }
+ else
+ {
+ if (G.zipfn_sgmnt_size < (int)strlen(G.zipfn)+ SGMNT_NAME_BOOST)
+ {
+ G.zipfn_sgmnt_size = strlen(G.zipfn)+ SGMNT_NAME_BOOST;
+ izu_free(G.zipfn_sgmnt);
+ if ((G.zipfn_sgmnt = izu_malloc(G.zipfn_sgmnt_size)) == NULL)
+ {
+ G.zipfn_sgmnt_size = -1;
return 1;
+ }
}
+ }
+
+
+ if (sgmnt_nr == G.ecrec.number_this_disk)
+ {
+ zfstrcpy(G.zipfn_sgmnt, G.zipfn);
+ return 0; /* Last segment. Name already ".zip." */
+ }
+
+#ifdef VMS
+
+ /* A VMS archive file spec may include a version number (";nnn"),
+ * confusing any simple scheme (like the one below). $PARSE can
+ * easily replace one file type with another (and null out the version
+ * number), so use it, instead.
+ */
+ vms_sgmnt_name( G.zipfn_sgmnt, G.zipfn, (sgmnt_nr+ 1));
+
+#else /* def VMS */
+
+ zfstrcpy(G.zipfn_sgmnt, G.zipfn);
+ /* Expect to find ".zXX" at the end of the segment file name. */
+ sufx_len = IZ_MAX( 0, ((int)strlen(G.zipfn_sgmnt)- 4));
+ suffix = G.zipfn_sgmnt+ sufx_len;
+
+ /* try find filename extension and set right position for add number */
+ if (zfstrcmp(suffix, ZSUFX) == 0)
+ {
+ suffix += 2; /* Point to digits after ".z". */
+# ifdef ZSUFX2
+ }
+ else if (zfstrcmp(suffix, ZSUFX2) == 0) /* Check alternate suffix. */
+ {
+ suffix[1] = 'z'; /* Should be always lowercase??? */
+ suffix += 2; /* Point to digits after ".z". */
+# endif
+ }
+ else
+ {
+ zfstrcpy( (suffix+ sufx_len), ZSUFX);
+ suffix += sufx_len+ 2;
+ }
+ /* Insert the next segment number into the file name (G.zipfn_sgmnt). */
+ sprintf(suffix, "%02d", (sgmnt_nr+ 1));
+
+#endif /* def VMS [else] */
+
+ return 0;
+} /* set_zipfn_sgmnt_name(). */
+
+
+/********************************/
+/* Function open_infile_sgmnt() */
+/********************************/
+int open_infile_sgmnt(__G__ movement)
+ __GDEF
+ int movement;
+{
+ zipfd_t zipfd;
+ zipfd_t zipfd_sgmnt;
+
+ if (movement == 0) /* Nothing to do. */
return 0;
-} /* end function open_input_file() */
+ zipfd = G.zipfd;
+ zipfd_sgmnt = G.zipfd_sgmnt;
+
+ /* Set the new segment file name. */
+ if (set_zipfn_sgmnt_name(G.sgmnt_nr+ movement))
+ return 1;
+ if (open_infile( __G OIF_SEGMENT))
+ {
+ /* TODO: ask for input and try it again */
+ /* error, load back old zipfn (it shouldn't be frequently) */
+ if (fd_is_valid(zipfd_sgmnt))
+ {
+ set_zipfn_sgmnt_name(G.sgmnt_nr);
+ }
+ else
+ {
+ /* Loading of central directory record probably??? */
+ izu_free(G.zipfn_sgmnt);
+ G.zipfn_sgmnt = NULL;
+ }
+ G.zipfd_sgmnt = zipfd_sgmnt;
+ return 1;
+ }
+
+ G.sgmnt_nr += movement;
+
+ /* close old file - yes, that's nasty solution */
+ /* Switch I/O to the new segment. */
+ G.zipfd = G.zipfd_sgmnt;
+ G.zipfd_sgmnt = zipfd; /* Old G.zipfd. */
+ CLOSE_INFILE( &G.zipfd_sgmnt);
+ if (fd_is_valid(zipfd_sgmnt)) /* Old G.zipfd_sgmnt. */
+ {
+ G.zipfd_sgmnt = G.zipfd;
+ }
+ else
+ {
+ izu_free(G.zipfn_sgmnt); /* We must clean it now. */
+ G.zipfn_sgmnt = NULL;
+ }
+
+ return 0;
+}
#if !defined(VMS) && !defined(AOS_VS) && !defined(CMS_MVS) && !defined(MACOS)
unsigned n;
n = size;
- while (size) {
- if (G.incnt <= 0) {
+ while (size)
+ {
+ if (G.incnt <= 0)
+ {
if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0)
- return (n-size);
- else if (G.incnt < 0) {
+ {
+ /* read() got no data. If the srchive is segmented, then
+ * try again with the next segment file.
+ */
+ /*if(fd_is_valid(G.zipfd_sgmnt)) {*/
+ if (G.ecrec.number_this_disk > 0)
+ {
+ if ((open_infile_sgmnt( 1) != 0) ||
+ (G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0)
+ return (n-size); /* Return short retry size. */
+ } else
+ return (n-size); /* Return short size. */
+ }
+
+ if (G.incnt < 0)
+ {
/* another hack, but no real harm copying same thing twice */
(*G.message)((zvoid *)&G,
(uch *)LoadFarString(ReadError), /* CANNOT use slide */
{
if (G.mem_mode)
return EOF;
- if (G.csize <= 0) {
+ if (G.csize <= 0)
+ {
G.csize--; /* for tests done after exploding */
G.incnt = 0;
return EOF;
}
- if (G.incnt <= 0) {
- if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0) {
- return EOF;
- } else if (G.incnt < 0) { /* "fail" (abort, retry, ...) returns this */
- /* another hack, but no real harm copying same thing twice */
+ if (G.incnt <= 0)
+ {
+ if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0)
+ {
+ /* read() got no data. If the srchive is segmented, then
+ * try again with the next segment file.
+ */
+ /* if(fd_is_valid(G.zipfd_sgmnt)) { */
+ if (G.ecrec.number_this_disk > 0)
+ {
+ if ((open_infile_sgmnt( 1) != 0) ||
+ (G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0)
+ return EOF;
+ } else
+ return EOF;
+ }
+
+ if (G.incnt < 0)
+ { /* "fail" (abort, retry, ...) returns this.
+ * another hack, but no real harm copying same thing twice.
+ */
(*G.message)((zvoid *)&G,
(uch *)LoadFarString(ReadError),
(ulg)strlen(LoadFarString(ReadError)), 0x401);
* "proper offset" (i.e., if there were no extra bytes prepended);
* cur_zipfile_bufstart contains the corrected offset.
*
- * Since seek_zipf() is never used during decompression, it is safe to
- * use the slide[] buffer for the error message.
+ * Because seek_zipf() is never used during decompression, it is safe
+ * to use the slide[] buffer for the error message.
*
* returns PK error codes:
* PK_BADERR if effective offset in zipfile is negative
* PK_EOF if seeking past end of zipfile
* PK_OK when seek was successful
*/
- zoff_t request = abs_offset + G.extra_bytes;
- zoff_t inbuf_offset = request % INBUFSIZ;
- zoff_t bufstart = request - inbuf_offset;
- if (request < 0) {
+/* zoff_t request = abs_offset + G.extra_bytes; */
+/* zoff_t inbuf_offset = request % INBUFSIZ; */
+/* zoff_t bufstart = request - inbuf_offset; */
+
+ zoff_t request;
+ zoff_t inbuf_offset;
+ zoff_t bufstart;
+
+ request = abs_offset + G.extra_bytes;
+
+#if 0 /* Pre-segment-support. */
+ if (request < 0)
+ {
+ Info(slide, 1, ((char *)slide, LoadFarStringSmall(SeekMsg),
+ 2, G.zipfn, LoadFarString(ReportMsg)));
+ return PK_BADERR;
+ }
+#endif /* 0 */ /* Pre-segment-support. */
+
+ while (request < 0)
+ {
+ if (G.sgmnt_size == 0)
+ {
+ if ((G.sgmnt_nr == 0) || open_infile_sgmnt(-1))
+ {
Info(slide, 1, ((char *)slide, LoadFarStringSmall(SeekMsg),
- G.zipfn, LoadFarString(ReportMsg)));
- return(PK_BADERR);
- } else if (bufstart != G.cur_zipfile_bufstart) {
- Trace((stderr,
- "fpos_zip: abs_offset = %s, G.extra_bytes = %s\n",
- FmZofft(abs_offset, NULL, NULL),
- FmZofft(G.extra_bytes, NULL, NULL)));
+ 3, G.zipfn, LoadFarString(ReportMsg)));
+ return PK_BADERR;
+ }
+ /* Get the new segment size, and calculate the new offset.
+ * This is where G.sgmnt_size gets a real (non-zero) value.
+ */
#ifdef USE_STRM_INPUT
- zfseeko(G.zipfd, bufstart, SEEK_SET);
- G.cur_zipfile_bufstart = zftello(G.zipfd);
+ zfseeko(G.zipfd, 0, SEEK_END);
+ G.sgmnt_size = zftello(G.zipfd);
#else /* def USE_STRM_INPUT */
- G.cur_zipfile_bufstart = zlseek(G.zipfd, bufstart, SEEK_SET);
-#endif /* def USE_STRM_INPUT [else] */
- Trace((stderr,
- " request = %s, (abs+extra) = %s, inbuf_offset = %s\n",
- FmZofft(request, NULL, NULL),
- FmZofft((abs_offset+G.extra_bytes), NULL, NULL),
- FmZofft(inbuf_offset, NULL, NULL)));
- Trace((stderr, " bufstart = %s, cur_zipfile_bufstart = %s\n",
- FmZofft(bufstart, NULL, NULL),
- FmZofft(G.cur_zipfile_bufstart, NULL, NULL)));
- if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0)
- return(PK_EOF);
- G.incnt -= (int)inbuf_offset;
- G.inptr = G.inbuf + (int)inbuf_offset;
- } else {
- G.incnt += (int)(G.inptr- G.inbuf) - (int)inbuf_offset;
- G.inptr = G.inbuf + (int)inbuf_offset;
+ G.sgmnt_size = zlseek(G.zipfd, 0, SEEK_END);
+#endif /* USE_STRM_INPUT */
+ request += G.sgmnt_size;
+ }
+ else
+ {
+ /* SMSd. Can we trust that all segments have the same size? */
+ /* We know segment size(s?), so we can calculate against
+ * abs_offset and sgmnt_nr, and open the segment file which we
+ * actually need.
+ */
+ unsigned int tmp_disk = G.ecrec.number_this_disk;
+
+ while (request < 0)
+ {
+ tmp_disk--;
+ request += G.sgmnt_size;
+ }
+ /* for same as actual disk (movement == 0) return 0 */
+ if (open_infile_sgmnt(tmp_disk - G.sgmnt_nr))
+ {
+ Info(slide, 1, ((char *)slide, LoadFarStringSmall(SeekMsg),
+ 4, G.zipfn, LoadFarString(ReportMsg)));
+ return PK_BADERR;
+ }
}
- return(PK_OK);
-} /* end function seek_zipf() */
+ /* In both cases we need to refill buffer, so set
+ * G.cur_zipfile_bufstart negative (so that bufstart !=
+ * G.cur_zipfile_bufstart, below).
+ */
+ G.cur_zipfile_bufstart = -1;
+ }
+
+ inbuf_offset = request % INBUFSIZ;
+ bufstart = request - inbuf_offset;
+
+ if (bufstart != G.cur_zipfile_bufstart)
+ {
+ Trace((stderr,
+ "fpos_zip: abs_offset = %s, G.extra_bytes = %s\n",
+ FmZofft(abs_offset, NULL, NULL),
+ FmZofft(G.extra_bytes, NULL, NULL)));
+#ifdef USE_STRM_INPUT
+ zfseeko(G.zipfd, bufstart, SEEK_SET);
+ G.cur_zipfile_bufstart = zftello(G.zipfd);
+#else /* def USE_STRM_INPUT */
+ G.cur_zipfile_bufstart = zlseek(G.zipfd, bufstart, SEEK_SET);
+#endif /* def USE_STRM_INPUT [else] */
+ Trace((stderr,
+ " request = %s, (abs+extra) = %s, inbuf_offset = %s\n",
+ FmZofft(request, NULL, NULL),
+ FmZofft((abs_offset+G.extra_bytes), NULL, NULL),
+ FmZofft(inbuf_offset, NULL, NULL)));
+ Trace((stderr, " bufstart = %s, cur_zipfile_bufstart = %s\n",
+ FmZofft(bufstart, NULL, NULL),
+ FmZofft(G.cur_zipfile_bufstart, NULL, NULL)));
+
+ if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) < INBUFSIZ)
+ {
+ /* If we're not at the end of file, then we need move to the
+ * next segment file.
+ * TODO: Check if EOF, instead?
+ */
+ if (G.ecrec.number_this_disk != G.sgmnt_nr)
+ {
+ int tmp;
+
+ if (open_infile_sgmnt(1))
+ return PK_EOF; /*TODO: Add some new return code? */
+
+ /* append rest of data to buffer - it's important when we are only
+ * few bytes before EOF and want read CDR! Now it's more safe.
+ * Only some disk error could be wrong for us in that case.
+ */
+ tmp = read(G.zipfd, (char *)(G.inbuf+ G.incnt), (INBUFSIZ- G.incnt));
+ if (tmp <= 0)
+ return PK_EOF;
+
+ G.incnt += tmp;
+ }
+ else if (G.incnt <= 0)
+ return PK_EOF;
+ }
+ G.incnt -= (int)inbuf_offset;
+ G.inptr = G.inbuf + (int)inbuf_offset;
+ }
+ else
+ {
+ G.incnt += (int)(G.inptr- G.inbuf) - (int)inbuf_offset;
+ G.inptr = G.inbuf + (int)inbuf_offset;
+ }
+ return PK_OK;
+} /* seek_zipf(). */
/************************/
int zipeof;
char *argv0; /* used for NT and EXE_EXTENSION */
char *wildzipfn;
- char *zipfn; /* GRR: WINDLL: must nuke any malloc'd zipfn... */
-# ifdef USE_STRM_INPUT
- FILE *zipfd; /* zipfile file descriptor */
-# else
- int zipfd; /* zipfile file handle */
-# endif
+ char *zipfn; /* zipfile path/name */
+ char *zipfn_sgmnt; /* zipfile segment path/name */
+ int zipfn_sgmnt_size; /* zipfile segment path/name size */
+ zuvl_t sgmnt_nr; /* zipfile segment number */
+ zoff_t sgmnt_size; /* zipfile segment size */
+ zipfd_t zipfd; /* zipfile primary file descr/pointer */
+ zipfd_t zipfd_sgmnt; /* zipfile segment file descr/pointer */
int zipstdin; /* Archive is stdin. */
zoff_t ziplen;
zoff_t cur_zipfile_bufstart; /* extract_or_test, readbuf, ReadByte */
# endif /* defined( ICONV_MAPPING) && defined( MAX_CP_NAME) */
# endif /* def UNICODE_SUPPORT */
-# ifdef CMS_MVS
+# ifdef CMS_MVS_INFILE_TMP
+ /* 2015-03-17 SMS. See note in zos/vmmvs.c. */
char *tempfn; /* temp file used; erase on close */
# endif
}
#endif /* def VMS */
- if (open_input_file(__G)) /* This should never fail, given */
- { /* the stat() test above, but... */
+ if (open_infile(__G__ OIF_PRIMARY))
+ { /* This should never fail, given the stat() test above, but... */
return PK_NOZIP;
}
if (G.ziplen == EOF)
{
Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileTooBig)));
- CLOSE_INFILE();
+ CLOSE_INFILE( &G.zipfd);
return IZ_ERRBF;
}
#endif /* DO_SAFECHECK_2GB */
G.cur_zipfile_bufstart = 0;
G.inptr = G.inbuf;
+ G.sgmnt_size = 0; /* Init before ECREC for each archive in the list. */
#if ((!defined(WINDLL) && !defined(SFX)) || !defined(NO_ZIPINFO))
# if !defined(WINDLL) && !defined(SFX)
IZ_MIN(G.ziplen, 66000L)))
> PK_WARN )
{
- CLOSE_INFILE();
+ CLOSE_INFILE( &G.zipfd);
#ifdef SFX
++lastchance; /* avoid picky compiler warnings */
}
if ((uO.zflag > 0) && !uO.zipinfo_mode) { /* unzip: zflag = comment ONLY */
- CLOSE_INFILE();
+ CLOSE_INFILE( &G.zipfd);
return error_in_archive;
}
else
Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileEmpty),
G.zipfn));
- CLOSE_INFILE();
+ CLOSE_INFILE( &G.zipfd);
return (error_in_archive > PK_WARN)? error_in_archive : PK_WARN;
}
+ /* Set the segment number (needed for segmented archives). */
+ G.sgmnt_nr = G.ecrec.number_this_disk;
+
/*-----------------------------------------------------------------------
Compensate for missing or extra bytes, and seek to where the start
of central directory should be. If header not found, uncompensate
error = seek_zipf(__G__ G.ecrec.offset_start_central_directory);
if (error == PK_BADERR) {
- CLOSE_INFILE();
+ CLOSE_INFILE( &G.zipfd);
return PK_BADERR;
}
#ifdef OLD_SEEK_TEST
if (error != PK_OK || readbuf(__G__ G.sig, 4) == 0) {
- CLOSE_INFILE();
+ CLOSE_INFILE( &G.zipfd);
return PK_ERR; /* file may be locked, or possibly disk error(?) */
}
if (memcmp(G.sig, central_hdr_sig, 4))
Info(slide, 0x401, ((char *)slide,
LoadFarString(CentDirStartNotFound), G.zipfn,
LoadFarStringSmall(ReportMsg)));
- CLOSE_INFILE();
+ CLOSE_INFILE( &G.zipfd);
return (error != PK_OK ? error : PK_BADERR);
}
#ifndef SFX
or test member files as instructed, and close the zipfile.
-----------------------------------------------------------------------*/
+ /* TODO: We need know offset against actual file!!! If we are
+ * not in the same file as EOCDR, it will fail always.
+ */
+
error = seek_zipf(__G__ G.ecrec.offset_start_central_directory);
if (error != PK_OK) {
- CLOSE_INFILE();
+ CLOSE_INFILE( &G.zipfd);
return error;
}
} /* end if (!too_weird_to_continue) */
#endif
- CLOSE_INFILE();
+ CLOSE_INFILE( &G.zipfd);
#ifdef TIMESTAMP
if (uO.T_flag && !uO.zipinfo_mode && (nmember > 0L)) {
--- /dev/null
+
+ globals.h:
+
+char *zipfn_part; char *zipfn_sgmnt
+int zipfn_part_size; int zipfn_sgmnt_size
+zuvl_t actual_disknumber; zuvl_t sgmnt_nr
+ulg zipfd_part_size; z_uint4 sgmnt_size
+ # ifdef USE_STRM_INPUT
+FILE *zipfd_part; FILE *zipfd_sgmnt
+ # else
+int zipfd_part; int zipfd_sgmnt
+
+
+
+ unzpriv.h
+
+# define CLOSE_PART_INFILE() CLOSE_INFILE_SGMNT()
+ close_part_infile(__G) close_infile_sgmnt(__G)
+
+# define CLOSE_INFILE() CLOSE_INFILE()
+ close_input_file(__G) close_infile(__G)
+
+# define CLOSE_PART_INFILE() CLOSE_INFILE_SGMNT()
+ close_input_part_file(__G) close_infile_sgmnt(__G)
+
+ Move [.zos]vmmvs.c:close_infile() code up to fileio.c.
+ Move close_infile() prototype out of CMS_MVS block.
+
+
+int open_input_part_file OF((__GPRO)); open_infile_sgmnt
+
+void close_input_file OF((__GPRO)); close_infile
+void close_input_part_file OF((__GPRO)); close_infile_sgmnt
+
+int open_next_input_part_file OF((__GPRO__ int movement));
+ open_infile_sgmnt
+
+int set_zipfn_part_name OF((__GPRO__ zuvl_t disknum));
+ set_zipfn_sgmnt_name
+
+FILE *vmmvs_open_part_infile OF((__GPRO)); vmmvs_open_infile_sgmnt
+void close_part_infile OF((__GPRO)); vmmvs_close_infile_sgmnt ???
+
+open_input_file() open_infile
+
+ extract.c
+
+close_segment()
+
+
+ fileio.c
+
+Need CLOSE_INFILE
+ CLOSE_INFILE_SGMNT
+ OPEN_INFILE
+ OPEN_INFILE_SGMNT
+ SET_ZIPFN_SGMNT_NAME
&optchar, &value, &negative,
&fna, &optnum, 0)))
{
- if(option == o_BAD_ERR) {
+ if (option == o_BAD_ERR)
+ {
FREE_NON_NULL( value); /* Leaving early. Free it. */
UPDATE_PARGV; /* See note 2013-01-17 SMS. */
return(PK_PARAM);
break;
# ifdef MACOS
case ('E'): /* -E [MacOS] display Mac e.f. when restoring */
- if( negative ) {
+ if (negative) {
uO.E_flag = FALSE, negative = 0;
} else {
uO.E_flag = TRUE;
# endif /* ndef SFX */
# ifdef MACOS
case ('i'): /* -i [MacOS] ignore filenames stored in Mac ef */
- if( negative ) {
+ if (negative) {
uO.i_flag = FALSE;
} else {
uO.i_flag = TRUE;
break;
# ifdef J_FLAG
case ('J'): /* Junk AtheOS, BeOS or MacOS[X] file attributes */
- if( negative ) {
+ if (negative) {
uO.J_flag = FALSE;
} else {
uO.J_flag = TRUE;
# endif /* def J_FLAG */
# if defined( UNIX) && defined( __APPLE__)
case (o_Je): /* Junk (all) extended attributes. */
- if( negative ) {
+ if (negative) {
uO.Je_flag = FALSE;
} else {
uO.Je_flag = TRUE;
}
break;
case (o_Jf): /* Junk Finder info. */
- if( negative ) {
+ if (negative) {
uO.Jf_flag = FALSE;
} else {
uO.Jf_flag = TRUE;
}
break;
case (o_Jq): /* Junk quarantine ("com.apple.quarantine") */
- if( negative ) {
+ if (negative) {
uO.Jq_flag = FALSE;
} else {
uO.Jq_flag = TRUE;
}
break;
case (o_Jr): /* Junk Resource fork. */
- if( negative ) {
+ if (negative) {
uO.Jr_flag = FALSE;
} else {
uO.Jr_flag = TRUE;
#ifdef CMS_MVS
# include "vmmvs.h"
-# define CLOSE_INFILE() close_infile(__G)
#endif
/*---------------------------------------------------------------------------
# define DATE_SEPCHAR '-'
#endif
#ifndef CLOSE_INFILE
-# define CLOSE_INFILE() close(G.zipfd)
+# define CLOSE_INFILE( pfd) close_infile(__G__ pfd)
#endif
#ifndef RETURN
# define RETURN return /* only used in main() */
#define GETPATH 4 /* retrieve the complete path and free it */
#define END 5 /* free root path prior to exiting program */
+/* Input archive file options for fileio.c:open_infile(). */
+#define OIF_PRIMARY 0 /* Primary archive (".zip") file. */
+#define OIF_SEGMENT 1 /* Segment archive (".zXX") file. */
+
/* version_made_by codes (central dir): make sure these */
/* are not defined on their respective systems!! */
#define FS_FAT_ 0 /* filesystem used by MS-DOS, OS/2, Win32 */
# endif
#endif
+ /* Archive file descriptor/pointer. */
+#ifdef USE_STRM_INPUT
+ typedef FILE *zipfd_t; /* Stdio file pointer. */
+#else /* def USE_STRM_INPUT */
+ typedef int zipfd_t; /* UNIX I/O file descriptor. */
+#endif /* def USE_STRM_INPUT */
+
#if (defined(GOT_UTIMBUF) || defined(sgi) || defined(ATARI))
typedef struct utimbuf ztimbuf;
#else
Functions in fileio.c:
---------------------------------------------------------------------------*/
-
-int open_input_file OF((__GPRO));
+int close_infile OF((__GPRO__ zipfd_t *pfd));
+int open_infile OF((__GPRO__ int which));
int open_outfile OF((__GPRO)); /* also vms.c */
+int set_zipfn_sgmnt_name OF((__GPRO__ zuvl_t sgmnt_nr));
void undefer_input OF((__GPRO));
void defer_leftover_input OF((__GPRO));
unsigned readbuf OF((__GPRO__ char *buf, register unsigned len));
#ifdef CMS_MVS
extent getVMMVSexfield OF((char *type, uch *ef_block, unsigned datalen));
- FILE *vmmvs_open_infile OF((__GPRO)); /* vmmvs.c */
+ FILE *vmmvs_open_infile OF((__GPRO__ char *fn)); /* vmmvs.c */
+#if 0
void close_infile OF((__GPRO)); /* vmmvs.c */
+#endif /* 0 */
#endif
/*---------------------------------------------------------------------------
# ifdef ENABLE_USER_PROGRESS
int establish_ctrl_t OF((void ctrl_t_ast())); /* vms.c */
# endif /* def ENABLE_USER_PROGRESS */
+ int vms_sgmnt_name OF((char *fn_sgmnt, /* vms.c */
+ char *fn_primary,
+ zuvl_t nr_sgmnt));
#endif /* def VMS */
/*---------------------------------------------------------------------------
/* ``Replace'' the unbuffered UNIX style I/O function with similar
* standard C functions from <stdio.h>.
*/
-# define read(fd,buf,n) fread((buf),1,(n),(FILE *)(fd))
-# ifdef zlseek
-# undef zlseek
-# endif
-# define zlseek(fd,o,w) zfseeko((FILE *)(fd),(o),(w))
-# define close(fd) fclose((FILE *)(fd))
-#endif /* USE_STRM_INPUT */
+# define read(fd,buf,n) fread((buf),1,(n),(FILE *)(fd))
+# ifdef zlseek
+# undef zlseek
+# endif
+# define zlseek(fd,o,w) zfseeko((FILE *)(fd),(o),(w))
+# define close(fd) fclose((FILE *)(fd))
+# define fd_is_valid(fd) (fd != NULL)
+#else /* def USE_STRM_INPUT */
+# ifdef _WIN32_WCE /* Really necessary? */
+# define fd_is_valid(fd) (fd != -1)
+# else /* def _WIN32_WCE [else] */
+# define fd_is_valid(fd) (fd >= 0)
+# endif /* def _WIN32_WCE [else] */
+#endif /* def USE_STRM_INPUT [else] */
/* The return value of the Info() "macro function" is never checked in
* UnZip. Otherwise, to get the same behaviour as for (*G.message)(), the
# endif
# ifdef BETA
-# define UZ_BETALEVEL "c16s BETA"
-# define UZ_VERSION_DATE "2015-03-11" /* Internal beta version. */
+# define UZ_BETALEVEL "c17s BETA"
+# define UZ_VERSION_DATE "2015-03-18" /* Internal beta version. */
# else
# define UZ_BETALEVEL ""
# define UZ_VERSION_DATE "2015-??-??" /* Official release version. */
# define UZ_PATCHLEVEL 0
-# define UZ_VER_STRING "6.10c16s" /* Keep in sync with Version numbers! */
+# define UZ_VER_STRING "6.10c17s" /* Keep in sync with Version numbers! */
# ifndef IZ_COMPANY_NAME
# define IZ_COMPANY_NAME "Info-ZIP"
/*
- Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
+ Copyright (c) 1990-2015 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2009-Jan-02 or later
(the contents of which are also included in unzip.h) for terms of use.
get_rms_defaults()
get_rms_fileprot()
name_only()
+ vms_sgmnt_name()
---------------------------------------------------------------------------*/
}
+/* vms_sgmnt_name()
+ *
+ * Derive an archive segment file spec from an archive primary file
+ * spec and the desired segment number. File specs are VMS-style.
+ * Returns sys$parse() status, with expanded file spec in user's
+ * storage.
+ */
+int vms_sgmnt_name( char *fn_sgmnt, char *fn_primary, zuvl_t nr_sgmnt)
+{
+ int sts;
+ char sgmnt_type[ 16];
+
+ struct FAB fab;
+ struct NAMX_STRUCT nam;
+ char e_name[ NAMX_MAXRSS + 1];
+
+ fab = cc$rms_fab; /* Initialize FAB. */
+ nam = CC_RMS_NAMX; /* Initialize NAM[L]. */
+ fab.FAB_NAMX = &nam; /* Point FAB to NAM[L]. */
+
+ /* Form a ".zXX;" type string and version from the segment number. */
+ sprintf( sgmnt_type, ".z%02u;", nr_sgmnt);
+
+ NAMX_DNA_FNA_SET( fab)
+
+ /* Use the primary archive name as the default file spec. */
+ FAB_OR_NAML( fab, nam).FAB_OR_NAML_DNA = fn_primary;
+ FAB_OR_NAML( fab, nam).FAB_OR_NAML_DNS = strlen( fn_primary);
+
+ /* Use the segment type and version as the normal file spec. */
+ FAB_OR_NAML( fab, nam).FAB_OR_NAML_FNA = sgmnt_type;
+ FAB_OR_NAML( fab, nam).FAB_OR_NAML_FNS = strlen( sgmnt_type);
+
+ nam.NAMX_ESA = e_name;
+ nam.NAMX_ESS = sizeof( e_name)- 1;
+
+ nam.NAMX_NOP = NAMX_M_SYNCHK; /* Syntax-only analysis. */
+ sts = sys$parse( &fab);
+ if ((sts & STS$M_SUCCESS) == STS$K_SUCCESS)
+ {
+ /* Save (NUL-terminated) result in user's storage. */
+ e_name[ nam.NAMX_ESL] = '\0';
+ strncpy( fn_sgmnt, nam.NAMX_ESA, (nam.NAMX_ESL+ 1));
+ }
+ else
+ {
+ fn_sgmnt[0] = '\0';
+ }
+
+ return sts;
+} /* vms_sgmnt_name(). */
+
/*
* 2007-01-29 SMS.
-Info-Zip UnZip -- Source kit. Version 6.10c15 (BETA) 13 Jan 2015.
+Info-Zip UnZip -- Source kit. Version 6.10c17s (pre-BETA) 2015-03-18.
See enclosed files INSTALL, LICENSE, and README. For information on
Info-Zip UnZip and Zip:
&optchar, &value, &negative,
&fna, &optnum, 0)))
{
- if(option == o_BAD_ERR) {
+ if (option == o_BAD_ERR)
+ {
FREE_NON_NULL( value); /* Leaving early. Free it. */
UPDATE_PARGV; /* See note 2013-01-17 SMS. */
return(PK_PARAM);
/* Function vmmvs_open_infile() */
/********************************/
-FILE *vmmvs_open_infile(__G)
+FILE *vmmvs_open_infile(__G__ fn)
__GDEF
+ char *fn;
{
FILE *fzip;
- G.tempfn = NULL;
+ fzip = fopen( fn, FOPR);
- fzip = fopen(G.zipfn, FOPR);
+#ifdef CMS_MVS_INFILE_TMP
-#if 0
/* Let's try it without the convert for a while -- RG Hartwig */
+ /* 2015-03-17 SMS.
+ * If ever re-enabled, this code will need changes to accommodate the
+ * additional archive segment file(s) (variable file name).
+ */
+
+ G.tempfn = NULL;
+
if ((fzip = fopen(G.zipfn,"rb,recfm=fb")) == NULL) {
size_t cnt;
char *buf;
G.ziplen = ftell(fzip);
}
-#endif
+#endif /* def CMS_MVS_INFILE_TMP */
return fzip;
}
/* Function close_infile() */
/***************************/
-void close_infile(__G)
- __GDEF
+int close_infile(__G__ pfd)
+ __GDEF
+ zipfd_t *pfd;
{
- fclose(G.zipfd);
+ int sts;
- /* If we're working from a temp file, erase it now */
- if (G.tempfn)
- remove(G.tempfn);
+ sts = fclose( *pfd);
+ *pfd = NULL;
-} /* end function close_infile() */
+#ifdef CMS_MVS_INFILE_TMP
+ /* If we're working from a temp file, erase it now */
+ if (G.tempfn)
+ remove(G.tempfn);
+#endif /* def CMS_MVS_INFILE_TMP */
+ return sts;
+} /* end function close_infile() */
/******************************/