[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]
zipfile::mkzip(n) 1.2 tcllib "Zip archive creation"
Name
zipfile::mkzip - Build a zip archive
Synopsis
- package require Tcl 8.6
- package require zipfile::mkzip ?1.2?
Description
This package utilizes the zlib functions in Tcl 8.6 to build zip archives.
API
- ::zipfile::mkzip::mkzip zipfile ?-zipkit? ?-runtime prefix? ?-comment string? ?-directory rootpath? ?-exclude exclude? ?--? ?path...?
-
This command constructs a zip archive from a directory tree using nothing but Tcl 8.6 core features. The resulting zip file should be compatible with other zip programs - with the possible exception of unicode support. The files generated by this command use utf-8 encoding for all filenames and comments and it has been noticed particularly on Windows the info-zip and the Windows built-in zip view have rather poor support for this part of the ZIP file specification. The 7-Zip program does correctly display utf8 filenames however and the vfs::zip package will use these of course.
If you use
::mkzip::mkzip mystuff.tm -zipkit -directory mystuff.vfs
it will pack your "mystuff.vfs/" virtual filesystem tree into a zip archive with a suitable header such that on unix you may mark it executable and it should run with tclkit. Or you can run it with tclsh or wish 8.6 if you like.
To change the executable header, specify the -runtime "preface" where preface is a file containing code you want prefixed. For instance, on Windows you can create a self-extracting zip archive using
mkzip mystuff.exe -directory mystuff.vfs -runtime unzipsfx.exe
The "unzipsfx.exe" is the Info-Zip self-extracting stub.
Accepted options:
Accepted arguments:
- path path
Each path is a directory or file to place into the generated archive. Note however that these will be ignored when option -directory is specified.
Bugs, Ideas, Feedback
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category zipfile of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.
Category
File
Copyright
Copyright © 2009 Pat Thoyts