Hi,
I’m trying to add a user config file to a plugin I’m working on.
I can upload it via the web interface, but it’s then stored compressed
Is there any easy way for a plugin’s end user to add a simple, uncompressed file that can later be read via Lua?
Or, can the compressed file be expanded via a Lua script?
Thanks,
Robert.
Hi,
You can use this Lua code to decompress a file:
os.execute("pluto-lzo d /etc/cmh-ludl/file.lzo /etc/cmh-ludl/file")
Or if the syntax of your config file is LUA code … i.e. a bunch of variable definitions or the definition of a table …
Vera Alerts has two definition files, one for system definitions, and one for user definitions.
They are stored as compressed Lua files and just loaded using the require statement.
Hi,
the decompression routine is perfect, thanks.
Robert.