Version 13 of inifile

Updated 2006-02-22 12:53:01

This package provides an interface for easy manipulation of Windows INI files

Reference doc can be found at http://tcllib.sourceforge.net/doc/ini.html

It is included in the 1.6 distribution of Tcllib.


Would be interesting to have an equivalent for Java properties files (which are like ini files but without sections). The inifile package requires you to have sections to work.

AK: See Tcllib Contribution & Feedback for ways to submit such a feature requests.


MHo: IMO this package has some serious disadvantages:

  • A different open mode has to be specified, depending on wether the inifile already exists or not. Why does the package not look by itself if the file exists and choose the appropiate open mode automatically?
  • Writing a comment for a non-existing key in a non-existing section does not lead to an error, but after commit nothing is written back
  • According to documentation, the sections are written in an arbitrary order and the keys in alphabetical order; this is very bad as INI files are frequently edited by hand too (this is one of the great advantes of inifiles over other methods: they are human-readable. But it's not funny if programmed access to well-commented and hand-designed INIs destroys the layout...). IMO it's absolutely neccessary to keep the existing order in INIs.
  • Names are treated case-sensitively wheras under MS Windows this is almost allways not common
  • Reading a non-existent key leads to an error. This requires extra-logic (use of ::ini::exists) and/or catching. It would be better if one could provide a default-value instead

There are other packages handling INI-access (don't remember if they are referenced somewhere in this wiki). Perhaps - for the MS Windows platform - it would be a better alternative to use native Win32-APIs (through [ffidl]), TWAPI...


category package from tcllib