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

Contents of /zip/README.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations)
Wed Jan 2 21:00:01 2008 UTC (6 years, 3 months ago) by dlichteblau
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
File MIME type: text/html
switched to salza2, thanks to Zach Beane
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 Send bug reports to <a
42 href="mailto:zip-devel@common-lisp.net">&lt;zip-devel@common-lisp.net&gt;</a>
43 (<a
44 href="http://common-lisp.net/cgi-bin/mailman/listinfo/zip-devel">list information</a>).
45 </p>
46 <p>
47 Thanks to <a href="http://common-lisp.net">common-lisp.net</a> for
48 hosting.
49 </p>
50 <p>
51 Uses <a href="http://www.xach.com/lisp/salza2/">salza2</a> for
52 compression, <a
53 href="http://www.weitz.de/flexi-streams/">flexi-streams</a> for external
54 format support, <a
55 href="http://common-lisp.net/project/cl-plus-ssl/#trivial-gray-streams">trivial-gray-streams</a>
56 for gray streams portability, and includes <a
57 href="http://opensource.franz.com/deflate/">inflate.cl</a>
58 for decompression.
59 </p>
60
61 <h2>Recent changes</h2>
62 <p>
63 2006-xx-yy: Fixed the gray stream port, including a data
64 corruption bug that was in CVS for some time. (Thanks to Kevin
65 Reid and others.) Switched to flexi-stream external-format
66 functions for portability. Uses trivial-gray-streams now.
67 Allegro 8.0 fix (thanks to Edi Weitz). Comment support (thanks
68 to Surendra Singhi). Incompatible change: Don't bind
69 <tt>*locale*</tt> on Allegro anymore.
70 <p>
71 </p>
72 2005-04-05: ACL fixes (thank to Edi Weitz). Lispworks port
73 (thanks to Sean Ross). Store <tt>file-write-date</tt> (also fixes
74 FilZip compatibility).
75 </p>
76
77 <h2>Download</h2>
78 <ul>
79 <li>asdf-install: <pre>(asdf-install:install :zip)</pre></li>
80 <li>Anoncvs (<a href="http://common-lisp.net/cgi-bin/viewcvs.cgi/zip/?cvsroot=zip">browse</a>):
81 <pre>$ export CVSROOT=:pserver:anonymous@common-lisp.net:/project/zip/cvsroot
82 $ cvs login
83 Logging in to :pserver:anonymous@common-lisp.net:2401/project/zip/cvsroot
84 CVS password: anonymous
85 $ cvs co zip</pre>
86 </li>
87 <li><a href="http://common-lisp.net/project/zip/zip.tgz">Tarball</a></li>
88 </ul>
89 <p>Installation (without asdf-install):</p>
90 <pre>$ ln -s `pwd`/zip.asd /your/system/directory
91 * (asdf:operate 'asdf:load-op :zip)</pre>
92
93 <h2>Portability</h2>
94 <p>
95 Needs gray streams. Currently works out-of-the-box on SBCL,
96 Lispworks, and ACL. Should be trivial to port to other Lisps.
97 </p>
98 <p>
99 Handles Unicode characters in filenames on ACL and Lispworks
100 (within the zip-file), is waiting for someone to fix Unicode
101 handling on SBCL.
102 </p>
103
104 <h2>ZIP-file reading</h2>
105 <p>
106 Zip archives are represented as opaque handles. Entries of the
107 zip-file are named by strings and represented as objects, too.
108 </p>
109
110 <div class="def">Function OPEN-ZIPFILE (pathname) => zipfile</div>
111 <p>
112 Open .zip-file <tt>pathname</tt> for reading and return a handle for it.
113 </p>
114 <div class="def">Function CLOSE-ZIPFILE (zipfile)</div>
115 <p>
116 Close the file handle.
117 </p>
118
119 <div class="def">Macro WITH-ZIPFILE ((var pathname) &body body) => result of body</div>
120 <p>
121 Bind <tt>var</tt> to the result of <tt>open-zipfile</tt>, evaluate
122 body as an implicit progn and call <tt>close-zipfile</tt> before
123 exiting.
124 </p>
125
126 <div class="def">Function GET-ZIPFILE-ENTRY (name zipfile) => zipfile-entry</div>
127 <p>Return an entry handle for the file called <tt>name</tt>.</p>
128 <div class="def">Function ZIPFILE-ENTRIES (zipfile) => hash-table</div>
129 <p>
130 Return a hash-table mapping filenames to entry handles for all
131 files contained in the zip archive.
132 </p>
133 <div class="def">Macro DO-ZIPFILE-ENTRIES ((name-var entry-var zipfile) &body body) => nil</div>
134 <p>
135 Map over all entries in <tt>zipfile</tt> binding <tt>name-var</tt>
136 and <tt>entry-var</tt> to each file name and entry handle in
137 turn. Establish implicit block named <tt>nil</tt> around the
138 loop.
139 </p>
140
141 <div class="def">Function ZIPFILE-ENTRY-NAME (zipfile-entry) => string</div>
142 <p>Return an entry's file name as a string.</p>
143 <div class="def">Function ZIPFILE-ENTRY-CONTENTS (entry &optional
144 stream) => see below</div>
145 <p>
146 If <tt>stream</tt> is given, extract <tt>entry</tt> to the
147 <tt>(unsigned-byte 8)</tt> stream given as the argument.
148 Otherwise, return the entry contents as an <tt>(unsigned-byte
149 8)</tt> vector.
150 </p>
151
152 <div class="def">Function UNZIP (pathname target-directory &key if-exists verbose) => nil</div>
153 <p>
154 Extract all entries from the zip archive at <tt>pathname</tt> into
155 <tt>target-directory</tt>. <tt>if-exists</tt> as for <a
156 href="http://www.xach.com/clhs.php?open">cl:open</a>.
157 </p>
158
159 <h2>ZIP-file writing</h2>
160 <p>
161 <tt>zipwriter</tt>s are handles used to create zip archives. They
162 are distinct from the zip handles used for reading.
163 </p>
164 <div class="def">Macro WITH-OUTPUT-TO-ZIPFILE ((var pathname &key if-exists) &body body)</div>
165 <p>
166 </p>
167
168 <div class="def">Function WRITE-ZIPENTRY (zipwriter name data &key file-write-date)</div>
169 <p>
170 Append a new entry called <tt>name</tt> to <tt>zipwriter</tt>.
171 Read data from <tt>(unsigned-byte 8)</tt> stream <tt>data</tt>
172 until EOF and compress it into "deflate"-format.
173 Use <tt>file-write-date</tt> as the entry's date and time.
174 Default to <tt>(file-write-date data)</tt>, use 1980-01-01T00:00
175 if <tt>nil</tt>.
176 </p>
177
178 <div class="def">Function ZIP (pathname source-directory &key if-exists)</div>
179 <p>
180 Compress all files in <tt>source-directory</tt> recursively into a
181 new zip archive at <tt>pathname</tt>. Note that entry file names
182 will not contain the name <tt>source-directory</tt>.
183 </p>
184
185 <h2>Bookmark</h2>
186 <p>
187 <a href="http://www.pkware.com/company/standards/appnote/appnote.txt">spec</a>
188 </p>
189 </body>
190 </html>

  ViewVC Help
Powered by ViewVC 1.1.5