Home Explore Blog CI



man-pages

4th chunk of `zip.man`
befad5c9fd360dab34e8d5b7702bed815c2dbe90292322f40000000100000fba
 Zip64 needs to be made before data is
       written for the entry, but for a stream the size  of  the  data  is  not
       known  at that point.  If the data is known to be smaller than 4 GB, the
       option -fz- can be used to prevent use of Zip64, but zip will exit  with
       an  error  if Zip64 was in fact needed.  zip 3 and unzip 6 and later can
       read archives with Zip64 entries.  Also, zip removes  the  Zip64  exten‐
       sions if not needed when archive entries are copied (see the -U (--copy)
       option).

       When  directing the output to another file, note that all options should
       be before the redirection including ‐x.  For example:

              zip archive "*.h" "*.c" ‐x donotinclude.h orthis.h > tofile

       Zip files.  When changing an existing zip archive, zip will write a tem‐
       porary file with the new contents, and only replace the old one when the
       process of creating the new version has been completed without error.

       If the name of the zip archive does not contain an extension, the exten‐
       sion .zip is added. If the name already contains an extension other than
       .zip, the existing extension is kept unchanged.  However, split archives
       (archives split over multiple files) require the .zip extension  on  the
       last split.

       Scanning and reading files.   When  zip  starts,  it  scans for files to
       process (if needed).  If this scan takes longer than  about  5  seconds,
       zip  will  display  a  "Scanning  files"  message  and  start displaying
       progress dots every 2  seconds  or  every  so  many  entries  processed,
       whichever takes longer.  If there is more than 2 seconds between dots it
       could  indicate  that  finding each file is taking time and could mean a
       slow network connection for example.  (Actually the initial file scan is
       a two‐step process where the directory scan is followed by  a  sort  and
       these  two steps are separated with a space in the dots.  If updating an
       existing archive, a space also appears between the  existing  file  scan
       and  the  new file scan.)  The scanning files dots are not controlled by
       the -ds dot size option, but the dots are turned off by the -q quiet op‐
       tion.  The -sf show files option can be used to scan for files  and  get
       the list of files scanned without actually processing them.

       If  zip  is  not able to read a file, it issues a warning but continues.
       See the -MM option below for more on how zip handles patterns  that  are
       not  matched  and  files  that  are  not  readable.   If some files were
       skipped, a warning is issued at the end of the zip operation noting  how
       many files were read and how many skipped.

       Command modes.   zip  now  supports two distinct types of command modes,
       external and internal.  The external modes (add,  update,  and  freshen)
       read  files  from  the file system (as well as from an existing archive)
       while the internal modes (delete and copy) operate  exclusively  on  en‐
       tries in an existing archive.

       add
              Update  existing  entries and add new files.  If the archive does
              not exist create it.  This is the default mode.

       update (-u)
              Update existing entries if newer on the file system and  add  new
              files.  If the archive does not exist issue warning then create a
              new archive.

       freshen (-f)
              Update  existing  entries of an archive if newer on the file sys‐
              tem.  Does not add new files to the archive.

       delete (-d)
              Select entries in an existing archive and delete them.

       copy (-U)
              Select entries in an existing archive and  copy  them  to  a  new
              archive.   This  new  mode  is similar to update but command line
              patterns select entries in the existing

Title: zip: Zip64, Output Redirection, File Scanning, and Command Modes
Summary
This section elaborates on Zip64 support in `zip`, detailing the use of the `-fz-` option to prevent Zip64 and compatibility with different unzip versions. It then discusses output redirection, emphasizing that all options should precede the redirection. The section covers zip archive handling, including the addition of the `.zip` extension and the scanning process with progress dots. It also details how zip handles unreadable files. Finally, it explains the different command modes: add, update, freshen, delete, and copy, describing their functionalities.