INIFile Plugin Overview

The INIFile plugin provides functions to read and write INI (initialization) files. INI files are simply 8-bit ASCII text files divided into sections, each section containing zero or more keys. For example:


There are a number of different flavors of INI files, you might even be familiar with some of them. Here are the formatting rules for INI files that will be used with the INIFile plugin. The only time you might need to be aware of these rules is if you plan to edit an INI file manually.

As in normal text files, lines are terminated by a CR (ASCII 13) character or a LF (ASCII 10) character (or a CRLF pair). This means that you can't store these values in an INI file without taking special measures, like encoding CR and LF before storing them.

With all of these restrictions, why would you want to store data in an INI file instead of a plain text file?

The INI file format provides structure to your data which makes storage and retrieval fast and convenient. When using an INI file, you don't have to parse the entire contents of the file to retrieve the data you want, the plugin handles all the details. You can read or write any data, at any point in the INI file, in any order you like. This is effectively a "poor man's database" that has almost no overhead.