Module luarocks.persist

Utility module for loading files into tables and saving tables into files. Implemented separately to avoid interdependencies, as it is used in the bootstrapping stage of config.

Functions

load_into_table (filename, tbl) Load a Lua file containing assignments, storing them in a table.
save_from_table (filename, tbl) Save contents of a table in a file


Functions

load_into_table (filename, tbl)
Load a Lua file containing assignments, storing them in a table. The global environment is not propagated to the loaded file.

Parameters

  • filename: string: the name of the file.
  • tbl: table or nil: if given, this table is used to store loaded values.

Return value:

table or (nil, string): a table with the file's assignments as fields, or nil and a message in case of errors.
save_from_table (filename, tbl)
Save contents of a table in a file

Parameters

  • filename:
  • tbl:

Return value:

boolean or (nil, string): true if successful, or nil and a message in case of errors.

Valid XHTML 1.0!