lua-users home
lua-l archive

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

Hello List members,

I'm working on a Wiki implementation, which is currently storing pages as plain textfiles, and the pagename is the filename:


In theory, this works just fine, but there are some major drawbacks:

   The file can't contain special characters (umlauts (like äöüß), or accents (like áéó) will result in corrupted filenames on windows)
   The file can't contain slashes or backslashes, the current engine replaces them with a dot (note that the engine would actually be perfectly able to parse PATH_INFO just fine to allow urls like "wiki.cgi/SomePage/With/Subpages", but instead it would return "wiki.cgi/SomePage.With.Subpage", the way dokuwiki behaves)
   Meta information, like diffs, last changed, authors and whatnot, would have to be stored in a separate file, which makes implementing these features rather tedious

So I was wondering what would be the best way to store the data in a, say, configurationfile like manner?

Python provies the "pickle" module. Pickle allows to store dictionaries, lists and tables in a file with binary representation (which kind of suggests that pickle doesn't care about encoding). Is there a similar thing for Lua, that allows to store tables and strings without having to care about quoting strings (and such)?