lua-users home
lua-l archive

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


Vyacheslav Egorov wrote:
I am searching a solution similiar to jar.
I want to pack both my and third party modules in one archive (lets call it lar), and then use it in another lua script/c program

You can use something like the excellent PhysicsFS <http://icculus.org/physfs> to access your scripts from a
zip/jar/whatever.  You can then write a quite
straightforward lar.execute() function in C that opens
the archive from PhysicsFS and reads it by passing a
PhysicsFS-using custom read-callback to lua_load().

I was going to paste the code that I use but it's so
specific to me that it'd be more confusing than helpful -
but really it's only about 70 lines and nothing very
spicy.

--Adam