红联Linux门户
Linux帮助

压缩和解压缩 cl-bzip2

发布时间:2012-08-13 10:16:17来源:红联作者:empast
cl-bzip2 是 Common Lisp 实现 bzip2 压缩和解压缩的开发包。

压缩示例代码:[code];;; Compression usage

;;; No values are returned if execution was successful
;;; Using pathnames
CL-USER> (bzip2:compress #p"test.txt" #p"test.txt.bz2")
; No value

;;; Using binary streams
CL-USER> (with-open-file (in "test.txt" :direction :input :element-type '(unsigned-byte 8))
(with-open-file (out "test.txt.bz2" :direction :output :element-type '(unsigned-byte 8))
(bzip2:compress in out)))
; No value

;;; Mixing stream and pathname
CL-USER> (with-open-file (in "test.txt" :direction :input :element-type '(unsigned-byte 8))
(bzip2:compress in #p"test.txt.bz2"))
; No value[/code]主页:http://common-lisp.net/project/cl-bzip2/

下载:http://common-lisp.net/project/cl-bzip2/cl-bzip2-0.1.0.tar.gz

来自:开源中国社区
文章评论

共有 0 条评论