lua-users home
lua-l archive

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


>> although it should be noted that the only problem is with file size and
>> hence resource loading time (once you get the data from lua you can cast
>> it to whatever type you want so it won't matter how lua stored it).
>
>If you don't care much about loading time then this might work:
>- Compress your (compiled) data files with gzip or bzip2.
>- Write a chunkreader that autodetects a compressed file and uncompresses
>  on-the-fly. The zlib/libbz2 manuals should have an example that does
>  exactly that.
>- Hook the chunkreader into your own dofile().

I wrote a library that can read Lua code from different sources (file,
memory),
passing it through uncompressing filters (bunzip2, gunzip).

The library is poorly written but maybe you can find something useful in it,
like the code necessary to uncompress files compressed with bzip2 and gzip.
It's
available at http://www.geocities.com/andre_leiradella/#luareader

Regards,

Andre de Leiradella
http://www.geocities.com/andre_leiradella/