[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua-Archive library started
- From: Jon Nalley <lists@...>
- Date: Fri, 2 Apr 2010 12:05:12 -0600
Nice work!
I am curious why you decided to implement the tar reader in straight
lua vs. creating lua bindings to a C library like libarchive?
http://code.google.com/p/libarchive/
Jon Nalley
On Thu, Apr 1, 2010 at 6:58 PM, Tom N Harris <telliamed@whoopdedo.org> wrote:
> http://code.google.com/p/lua-archive/
>
> The Lua Archive library can read and write compressed files in a variety of
> formats. Modules are provided for direct compression and decompression
> (zlib, bzip2), reading simply compressed files (gz, bz2), and for working
> with multi-file archives (tar, zip). Other formats, such as lzma, will be
> added soon.
>
> Using zlib:
> decompressed = larc.zlib.decompress(compressed)
> z = larc.zlib.compressor{level=9}
> file:write(z(string.rep('a',100)))
> file:write(z(string.rep('b',100)))
> file:write(z()) -- flushes the output
>
> Reading a bz2 file:
> bz2 = larc.bzfile.open("test.bz2")
> print(bz2:read("*line"))
>
> Reading a zip file:
> zip = larc.zipfile.open("test.zip")
> for file in zip:names() do
> if string.match(file, "%.txt$") then
> zip:extract(file)
> end
> end
>
> Lua Archive has a BSD-like license.
>
> --
> - tom
> telliamed@whoopdedo.org
>