cl-bzip2是CommonLisp实现bzip2压缩和解压缩的开发包。
压缩示例代码:
;;;Compressionusage;;;Novaluesarereturnedifexecutionwassuccessful;;;UsingpathnamesCL-USER>(bzip2:compress#p"test.txt"#p"test.txt.bz2");Novalue;;;UsingbinarystreamsCL-USER>(with-open-file(in"test.txt":direction:input:element-type'(unsigned-byte8))(with-open-file(out"test.txt.bz2":direction:output:element-type'(unsigned-byte8))(bzip2:compressinout)));Novalue;;;MixingstreamandpathnameCL-USER>(with-open-file(in"test.txt":direction:input:element-type'(unsigned-byte8))(bzip2:compressin#p"test.txt.bz2"));Novalue
评论