/[zip]/zip/README.html
ViewVC logotype

Contents of /zip/README.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Tue Apr 5 15:04:33 2005 UTC (9 years ago) by dlichteblau
Branch: MAIN
Changes since 1.1: +5 -4 lines
File MIME type: text/html
merged Lispworks patch, thanks to Sean Ross
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <title>Common Lisp ZIP library</title>
6 <style type="text/css">
7 body {
8 color: #000000;
9 background-color: #ffffff;
10 margin-bottom: 10%;
11 padding-left: 30px;
12 }
13 h1,h2,h3 {
14 margin-left: -30px;
15 }
16 pre {
17 background-color: #eeeeee;
18 border: solid 1px #d0d0d0;
19 padding: 1em;
20 margin-right: 10%;
21 }
22 .def {
23 background-color: #ddddff;
24 font-weight: bold;
25 }
26 .nomargin {
27 margin-bottom: 0;
28 margin-top: 0;
29 }
30 </style>
31 </head>
32 <body>
33 <h1>Common Lisp ZIP library</h1>
34
35 <p>A library for .zip-file reading and writing, written in Common Lisp.</p>
36
37 <p>
38 Written by David Lichteblau &lt;david@lichteblau.com&gt;.
39 </p>
40 <p>
41 Thanks to <a href="http://common-lisp.net">common-lisp.net</a> for
42 hosting.
43 </p>
44 <p>
45 Uses <a href="http://www.cliki.net/salza">salza</a> for compression.
46 </p>
47
48 <h2>Download</h2>
49 <ul>
50 <li>asdf-install: <pre>(asdf-install:install :zip)</pre></li>
51 <li>Anoncvs:
52 <pre>$ export CVSROOT=:pserver:anonymous@common-lisp.net:/project/zip/cvsroot
53 $ cvs login
54 Logging in to :pserver:anonymous@common-lisp.net:2401/project/zip/cvsroot
55 CVS password: anonymous
56 $ cvs co zip</pre>
57 </li>
58 <li><a href="http://common-lisp.net/project/zip/zip.tgz">Tarball</a></li>
59 </ul>
60 <p>Installation (without asdf-install):</p>
61 <pre>$ ln -s `pwd`/zip.asd /your/system/directory
62 * (asdf:operate 'asdf:load-op :zip)</pre>
63
64 <h2>Portability</h2>
65 <p>
66 Needs gray streams. Currently works out-of-the-box on SBCL,
67 Lispworks, and ACL. Should be trivial to port to other Lisps.
68 </p>
69 <p>
70 Handles Unicode characters in filenames on ACL and Lispworks
71 (within the zip-file), is waiting for someone to fix Unicode
72 handling on SBCL.
73 </p>
74
75 <h2>ZIP-file reading</h2>
76 <p>
77 Zip archives are represented as opaque handles. Entries of the
78 zip-file are named by strings and represented as objects, too.
79 </p>
80
81 <div class="def">Function OPEN-ZIPFILE (pathname) => zipfile</div>
82 <p>
83 Open .zip-file <tt>pathname</tt> for reading and return a handle for it.
84 </p>
85 <div class="def">Function CLOSE-ZIPFILE (zipfile)</div>
86 <p>
87 Close the file handle.
88 </p>
89
90 <div class="def">Macro WITH-ZIPFILE ((var pathname) &body body) => result of body</div>
91 <p>
92 Bind <tt>var</tt> to the result of <tt>open-zipfile</tt>, evaluate
93 body as an implicit progn and call <tt>close-zipfile</tt> before
94 exiting.
95 </p>
96
97 <div class="def">Function GET-ZIPFILE-ENTRY (name zipfile) => zipfile-entry</div>
98 <p>Return an entry handle for the file called <tt>name</tt>.</p>
99 <div class="def">Function ZIPFILE-ENTRIES (zipfile) => hash-table</div>
100 <p>
101 Return a hash-table mapping filenames to entry handles for all
102 files contained in the zip archive.
103 </p>
104 <div class="def">Macro DO-ZIPFILE-ENTRIES ((name-var entry-var zipfile) &body body) => nil</div>
105 <p>
106 Map over all entries in <tt>zipfile</tt> binding <tt>name-var</tt>
107 and <tt>entry-var</tt> to each file name and entry handle in
108 turn. Establish implicit block named <tt>nil</tt> around the
109 loop.
110 </p>
111
112 <div class="def">Function ZIPFILE-ENTRY-NAME (zipfile-entry) => string</div>
113 <p>Return an entry's file name as a string.</p>
114 <div class="def">Function ZIPFILE-ENTRY-CONTENTS (entry &optional
115 stream) => see below</div>
116 <p>
117 If <tt>stream</tt> is given, extract <tt>entry</tt> to the
118 <tt>(unsigned-byte 8)</tt> stream given as the argument.
119 Otherwise, return the entry contents as an <tt>(unsigned-byte
120 8)</tt> vector.
121 </p>
122
123 <div class="def">Function UNZIP (pathname target-directory &key if-exists verbose) => nil</div>
124 <p>
125 Extract all entries from the zip archive at <tt>pathname</tt> into
126 <tt>target-directory</tt>. <tt>if-exists</tt> as for <a
127 href="http://www.xach.com/clhs.php?open">cl:open</a>.
128 </p>
129
130 <h2>ZIP-file writing</h2>
131 <p>
132 <tt>zipwriter</tt>s are handles used to create zip archives. They
133 are distinct from the zip handles used for reading.
134 </p>
135 <div class="def">Macro WITH-OUTPUT-TO-ZIPFILE ((var pathname &key if-exists) &body body)</div>
136 <p>
137 </p>
138
139 <div class="def">Function WRITE-ZIPENTRY (zipwriter name data)</div>
140 <p>
141 Append a new entry called <tt>name</tt> to <tt>zipwriter</tt>.
142 Read data from <tt>(unsigned-byte 8)</tt> stream <tt>data</tt>
143 until EOF and compress it into "deflate"-format.
144 </p>
145
146 <div class="def">Function ZIP (pathname source-directory &key if-exists)</div>
147 <p>
148 Compress all files in <tt>source-directory</tt> recursively into a
149 new zip archive at <tt>pathname</tt>. Note that entry file names
150 will not contain the name <tt>source-directory</tt>.
151 </p>
152 </body>
153 </html>

  ViewVC Help
Powered by ViewVC 1.1.5