lua-users home
lua-l archive

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


In my spare time I'm working to a pure lua .zip file reading facility on
top of lzlib (that may make the dependency of lua-zip on libzzip
unnecessary). 

The easy part consists in providing a regular file interface to
compressed files, since lzlib allows you to read using the '*all' and
'*l' modifiers, provided a function/file-descriptor to fetch compressed
data from.

The "hard" part is that .zip allows to store files in uncompressed
format, thus the original file is just stored in the .zip file starting
at a given offset with its length stored in the .zip header. 
Clearly I can not return a regular file handler: I can seek at the
beginning of the uncompressed data, but I've no way to tell the regular
file handler that the file has a given size (and thus an EOF must be
simulated before the real EOF)

I could wrap the file handler, honouring the real file size, but maybe
someone around here has a better idea...

Thanks in advance.
-- 
Enrico Tassi