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

Contents of /zip/README.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Sun Apr 3 20:38:19 2005 UTC (9 years ago) by dlichteblau
Branch: MAIN
File MIME type: text/html
README HTMLifiziert
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 and ACL.
67 Should be trivial to port to other Lisps.
68 </p>
69 <p>
70 Handles Unicode characters in filenames on ACL (within the zip-file), is
71 waiting for someone to fix Unicode handling on SBCL.
72 </p>
73
74 <h2>ZIP-file reading</h2>
75 <p>
76 Zip archives are represented as opaque handles. Entries of the
77 zip-file are named by strings and represented as objects, too.
78 </p>
79
80 <div class="def">Function OPEN-ZIPFILE (pathname) => zipfile</div>
81 <p>
82 Open .zip-file <tt>pathname</tt> for reading and return a handle for it.
83 </p>
84 <div class="def">Function CLOSE-ZIPFILE (zipfile)</div>
85 <p>
86 Close the file handle.
87 </p>
88
89 <div class="def">Macro WITH-ZIPFILE ((var pathname) &body body) => result of body</div>
90 <p>
91 Bind <tt>var</tt> to the result of <tt>open-zipfile</tt>, evaluate
92 body as an implicit progn and call <tt>close-zipfile</tt> before
93 exiting.
94 </p>
95
96 <div class="def">Function GET-ZIPFILE-ENTRY (name zipfile) => zipfile-entry</div>
97 <p>Return an entry handle for the file called <tt>name</tt>.</p>
98 <div class="def">Function ZIPFILE-ENTRIES (zipfile) => hash-table</div>
99 <p>
100 Return a hash-table mapping filenames to entry handles for all
101 files contained in the zip archive.
102 </p>
103 <div class="def">Macro DO-ZIPFILE-ENTRIES ((name-var entry-var zipfile) &body body) => nil</div>
104 <p>
105 Map over all entries in <tt>zipfile</tt> binding <tt>name-var</tt>
106 and <tt>entry-var</tt> to each file name and entry handle in
107 turn. Establish implicit block named <tt>nil</tt> around the
108 loop.
109 </p>
110
111 <div class="def">Function ZIPFILE-ENTRY-NAME (zipfile-entry) => string</div>
112 <p>Return an entry's file name as a string.</p>
113 <div class="def">Function ZIPFILE-ENTRY-CONTENTS (entry &optional
114 stream) => see below</div>
115 <p>
116 If <tt>stream</tt> is given, extract <tt>entry</tt> to the
117 <tt>(unsigned-byte 8)</tt> stream given as the argument.
118 Otherwise, return the entry contents as an <tt>(unsigned-byte
119 8)</tt> vector.
120 </p>
121
122 <div class="def">Function UNZIP (pathname target-directory &key if-exists verbose) => nil</div>
123 <p>
124 Extract all entries from the zip archive at <tt>pathname</tt> into
125 <tt>target-directory</tt>. <tt>if-exists</tt> as for <a
126 href="http://www.xach.com/clhs.php?open">cl:open</a>.
127 </p>
128
129 <h2>ZIP-file writing</h2>
130 <p>
131 <tt>zipwriter</tt>s are handles used to create zip archives. They
132 are distinct from the zip handles used for reading.
133 </p>
134 <div class="def">Macro WITH-OUTPUT-TO-ZIPFILE ((var pathname &key if-exists) &body body)</div>
135 <p>
136 </p>
137
138 <div class="def">Function WRITE-ZIPENTRY (zipwriter name data)</div>
139 <p>
140 Append a new entry called <tt>name</tt> to <tt>zipwriter</tt>.
141 Read data from <tt>(unsigned-byte 8)</tt> stream <tt>data</tt>
142 until EOF and compress it into "deflate"-format.
143 </p>
144
145 <div class="def">Function ZIP (pathname source-directory &key if-exists)</div>
146 <p>
147 Compress all files in <tt>source-directory</tt> recursively into a
148 new zip archive at <tt>pathname</tt>. Note that entry file names
149 will not contain the name <tt>source-directory</tt>.
150 </p>
151 </body>
152 </html>

  ViewVC Help
Powered by ViewVC 1.1.5