Inspired of some old PowerBASIC/DOS-code I've written 1000 years ago to handle INI-files, and in conjuction with what I said on the [inifile]-page, I've started to write another INI file parser in TCL by myself as a evening fun project. This is the first result, don't expect anything from it... (only reading is possible for now! Not much error checking is done.): proc iniRead1 {ini args} { set h [open $ini r] catch {array set i [join $args]}; # optional defaults set currentSection {} while {[gets $h line] > -1} { # maybe somtimes: interpret trailing \, respect {blocks} like Tcl set line [string trim $line]; # remove junk # ;comments and blanklines are not of interest yet if {[string length $line] == 0 || [string range $line 0 0] == ";"} { continue; # I think we don't need no regexps for such primitive stuff } # recognize Sections if {[string length $line] > 2 && [string range $line 0 0] == {[} && [string range $line end end] == {]}} { set currentSection [string range $line 1 end-1] } # recognize Keywords, but only if a section already exists set eq [string first = $line]; # keyword must be at leas 1 char long... if {$eq > 0 && [string length $currentSection]} { incr eq -1; set Key [string range $line 0 $eq] incr eq 2; set Val [string range $line $eq end] # to be done: (optional) \backslash and %envvar%-substitution set i($currentSection,$Key) [string trim $Val {"}] } } close $h return [array get i] } I don't used any sophisticated or mysterious technics in the code above; it should pe portable to any language you can think of... However, in my old PowerBASIC-Units i had implemented a few extra functions to overcome some restrictions of standard INI's, e.g.: * reading of "keywordless" sections - the whole text after a [[sectionname]] is returned (to support large sections of text in inis) * optional replacement of %EnvironmentVariables% in the values * support of an index appended to the ini file which speeds up access to inis to a level comparable to random files... (remember: in DOS-days it wasn't wise to waste memory; so my program was designed to give back the values of only one section with one call; so - each call was a new file access, no buffering in memory...) The next step to take is to program the write access. Should not be much more difficult. But as usual, many different ideas of how to pass parameters to and results back from my procedures spook through my brain, I still don't have a general solution for it... I'm still not shure if it is required to support programmatically access to the ''comments'' of an ini file. I think, the usual programmer is mostly interested in getting the values. Ok, if a program ''writes'' an ini file it possibly makes sense to write comments, though.