zip.ss: Creating zip Files

To load: (require (lib "zip.ss"))

This library provides a facility for creating zip files, which are compatible with both Windows and Unix and Mac OS X. The actual compression is implemented by deflate (see Chapter 14). The most useful entry point for this library is zip.

(zip zip-file path ···)      PROCEDURE

Creates zip-file, which holds the complete content of all paths. The given paths are all expected to be relative path names of existing directories and files (i.e., relative to the current directory). If a nested path is provided as a path, its ancestor directories are also added to the resulting zip file, up to the current directory (using pathlist-closure; see section 11.3.3 in PLT MzScheme: Language Manual). Files are packaged as usual for zip files, including permission bits for both Windows and Unix and Mac OS X. The permission bits are determined by file-or-directory-permissions (section 11.3.3 in PLT MzScheme: Language Manual), so it does not preserve the distinction between owner/group/other permissions; also, symbolic links are always followed.

(zip->output paths [output-port])      PROCEDURE

Zips each of the given paths, and packages it as a zip ``file'' that is written directly to the output-port or to the current output port if output-port is not given. Also, the specified paths are included as-is; if a directory is specified, its content is not automatically added, and nested directories are added without parent directories.

(zip-verbose [on?])      PROCEDURE

A parameter that controls output during a zip operation. Setting this parameter to a true value will cause zip to display (on the current error port) the filename that is currently being compressed.

(See also section 44.)