Skip to content

unzip the rip-off version #2

@elpiel

Description

@elpiel

So as a rip-off version of unzip we basically need to support everything that it does: https://linux.die.net/man/1/unzip

The following options need to be implemented:

(Edit: I added a list of all options)

Priorities

I added an score from 1 to 3 to every flag/option being 1 the ones that I think should go first and 5 the one we can leave for later. What do you think?

In total: 14 ones, 11 twos and 24 threes.

Arguments (1)

  • file[.zip] / [file(s)]
    This sections specifies how *, ? and [...] are represented. I think we can go full RegExp like Ripgrep.

  • [-x xfile(s)]
    Same here, we can go full RegExp

  • [-d exdir]

Options

  • -Z (3)

zipinfo(1L) mode. I

  • -A (3) - Do we want to do this? It may not apply

[OS/2, Unix DLL] print extended help for the DLL's programming interface (API).

  • -c (2)

extract files to stdout/screen (''CRT'').

  • -f (2)

freshen existing files, i.e., extract only those files that already exist on disk and that are newer than the disk copies.

  • -l (1)

list archive files (short format). The names, uncompressed file sizes and modification dates and times of the specified files are printed, along with totals for all files specified.

  • -p (1)

extract files to pipe (stdout).

  • -t (1)

test archive files.

  • -T (3)

[most OSes] set the timestamp on the archive(s) to that of the newest file in each one. This corresponds to zip's -go option except that it can be used on wildcard zipfiles (e.g., ''unzip -T *.zip'') and is much faster.

  • -u (2)

update existing files and create new ones if needed.

  • -v (3) - 3 because of complexity. It has several behaviors depending of other flags and it is not even full implemented in zip

list archive files (verbose format) or show diagnostic version info. This option has evolved and now behaves as both an option and a modifier.

  • -z (1)

display only the archive comment.

Modifiers

  • -a (2)

convert text files.

  • -b (3)

[general] treat all files as binary (no text conversions). This is a shortcut for ---a.

  • -b (3)

[Tandem] force the creation files with filecode type 180 ('C') when extracting Zip entries marked as "text". (On Tandem, -a is enabled by default, see above).

  • -b (3)

[VMS] auto-convert binary files (see -a above) to fixed-length, 512-byte record format.

  • -B (3)

[when compiled with UNIXBACKUP defined] save a backup copy of each overwritten file. The backup file is gets the name of the target file with a tilde and optionally a unique sequence number (up to 5 digits) appended.

  • -C (2)

use case-insensitive matching for the selection of archive entries from the command-line list of extract selection patterns.

  • -D (2)

skip restoration of timestamps for extracted items.

  • -E (3)

[MacOS only] display contents of MacOS extra field during restore operation.

  • -F (3)

[Acorn only] suppress removal of NFS filetype extension from stored filenames.

  • -F (3)

[non-Acorn systems supporting long filenames with embedded commas, and only if compiled with ACORN_FTYPE_NFS defined] translate filetype information from ACORN RISC OS extra field blocks into a NFS filetype extension and append it to the names of the extracted files. (When the stored filename appears to already have an appended NFS filetype extension, it is replaced by the info from the extra field.)

  • -i (3)

[MacOS only] ignore filenames stored in MacOS extra fields. Instead, the most compatible filename stored in the generic part of the entry's header is used.

  • -j (2)

junk paths. The archive's directory structure is not recreated; all files are deposited in the extraction directory (by default, the current one).

  • -J (3)

[BeOS only] junk file attributes. The file's BeOS file attributes are not restored, just the file's data.

  • -J (3)

[MacOS only] ignore MacOS extra fields. All Macintosh specific info is skipped. Data-fork and resource-fork are restored as separate files.

  • -K (3)

[AtheOS, BeOS, Unix only] retain SUID/SGID/Tacky file attributes. Without this flag, these attribute bits are cleared for security reasons.

  • -L (3)

convert to lowercase any filename originating on an uppercase-only operating system or file system.

  • -M (2)

pipe all output through an internal pager similar to the Unix more(1) command.

  • -n (1)

never overwrite existing files.

  • -N (3)

[Amiga] extract file comments as Amiga filenotes. File comments are created with the -c option of zip(1L), or with the -N option of the Amiga port of zip(1L), which stores filenotes as comments.

-o (1)

overwrite existing files without prompting.

-q (1)

perform operations quietly (-qq = even quieter).

  • -s (3)

[OS/2, NT, MS-DOS] convert spaces in filenames to underscores.

  • -S (3)

[VMS] convert text files (-a, -aa) into Stream_LF record format, instead of the text-file default, variable-length record format.

  • -U (3)

[UNICODE_SUPPORT only] modify or disable UTF-8 handling.

  • -V (3)

retain (VMS) file version numbers.

  • -W (3)

[only when WILD_STOP_AT_DIR compile-time option enabled] modifies the pattern matching routine so that both '?' (single-char wildcard) and '*' (multi-char wildcard) do not match the directory separator character '/'.

  • -X (3)

[VMS, Unix, OS/2, NT, Tandem] restore owner/protection info

  • -Y (3)

[VMS] treat archived file name endings of ''.nnn'' (where ''nnn'' is a decimal number) as if they were VMS version numbers.

  • -$ (3)

[MS-DOS, OS/2, NT] restore the volume label if the extraction medium is removable (e.g., a diskette). Doubling the option allows fixed media (hard disks) to be labelled as well.

  • -: (2)

[all but Acorn, VM/CMS, MVS, Tandem] allows to extract archive members into locations outside of the current '' extraction root folder''.

  • -^ (2)

[Unix only] allow control characters in names of extracted ZIP archive entries.

  • -2 (2)

[VMS] force unconditionally conversion of file names to ODS2-compatible names.

Environment Options

  • _ (1) unzip's default behavior may be modified via options placed in an environment variable.

Decryption

  • Yes (1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    trackingTracking issue for all the required componets

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions