lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, 2008-05-09 at 12:07 +0000, George Petsagourakis wrote:
> I'd like to ask how can someone open bz2 compressed files.
> Please indicate libraries to use.

libbz2 :)

I don't know if anybody has written a Lua binding to this library, but
it shouldn't be tricky to do so.  Also, if your build of Lua has popen
support, you can ask the bzip2 command line tools to write decompressed
data out in a way you can read in.

For example:

	f = io.popen("bunzip2 -c filename.bz", "r")

And then read from f as if it were a normal file stream - note that this
means you cannot seek.

B.