There are a bunch of good Perl modules for dealing with ini files. You might look at them (CPAN), not that you have to actually use them, but their source might help. Too bad that you have to write an ini parser when so many already exist in perl.
Cheers, Scott -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick J. LoPresti Sent: Tuesday, June 17, 2003 3:51 PM To: [EMAIL PROTECTED] Subject: [Unattended] .ini file syntax? While it is fresh on my mind... Does anybody know the precise syntax of .ini files? I mean files which look like this: [Section1] key1 = value1 ; comment1 key2 = value2 [Section2] key3 ; no value key4 = "some value" ... (Case in point: unattend.txt) A formal grammar would be ideal. I know, keep dreaming. Meanwhile, I would like to find out: - Which characters are legal in section names, keys, and values? - When and where are quotation marks required? - Can you embed a quotation mark inside a key or value? How? - Can you embed a close-bracket inside a section name? What about a semicolon? - Can individual key=value settings span multiple lines? How? I believe Windows has an API for manipulating .ini files. It should be straightforward to experiment by manually editing a file and then calling the API on it. I may do this when I find the time, but it would be great if someone already knows the answers or could do the experiments for me :-). - Pat