[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Roberto book, persistance, data structures
- From: Philippe Lhoste <PhiLho@...>
- Date: Wed, 18 Jul 2001 17:39:04 +0200 (MEST)
Nicolas Devillard wrote:
> On Wed, 18 Jul 2001, Philippe Lhoste wrote:
> [...]
> > The .ini format is fine, except it doesn't support multi-users (or you
> > must handle these by hand), and it is not hierarchical.
>
> The ini file format can be made hierarchical by reserving a character as a
> separator in the section names. Example: with '/':
>
> [Section/Subsection1]
> [Section/Subsection2]
> ...
I knew that, as it is the format used for .reg files.
But it is very verbose and not practical.
> Use any character you want as long as it is not used in a section label,
> and you have your hierarchical ini file. Not the best but you can find
> parsers for ini file all over the place so you do not have to reinvent the
> wheel.
I agree, that's why I plan to use Lua for that...
> All depends on how hierarchical you need your file to be. XML might
> also be a choice there.
Well, an XML parser like Expat is about the same size than the Lua parser,
but it can't be used for scripting... And XML is a chore to code by hand.
OTOH, it is quite standard.
> As to making the ini file aware of different users, nothing prevents you
> >from using a naming scheme to do that, something like appli-user1.ini,
> appli-user2.ini, etc.
That's what I meant by "you must handle these by hand". Either that, or
creating one section by user.
> Many, many solutions for config files out there. Have a look into
> freshmeat for starters :-)
Been there, done that. Some interesting solutions, but I still prefer to use
Lua...
> Cheers
Thank you for the tips and pointers.
> --
> Nicolas
Regards.
--
--._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`--
Sent through GMX FreeMail - http://www.gmx.net