An initialization file is a convenient place to store information between sessions. Profile Manager enables applications to create their own initialization files and to access the OS/2 initialization files, os2.ini and os2sys.ini. Just as the system uses the os2.ini and os2sys.ini files to store configuration information for system startup, an application can create an initialization file that stores information it uses to initialize windows and data.

The system initialization files contain sections and settings used by the PM applications. Although applications can read settings from the initialization files, only rarely does an application need to change a setting. OS/2 initialization files are binary; the user cannot view or edit them directly.

An initialization file consists of one or more sections; each section contains one or more settings, or keys. Each key consists of two parts: a name and a value. Both section names and key names are null-terminated strings. The value assigned to a key can be a null-terminated string, a null-terminated string representing a signed integer, or individual bytes of data.

Once an initialization file is created, an application can rename, copy, move, or delete that file just as it does any other file. Although an application also could read directly to or write directly to the initialization file, the application should always use Profile Manager functions to access the contents of the file. Both character-based OS/2 applications and PM applications can use Profile Manager functions. Before calling Profile Manager, a thread must initialize an anchor block by using the WinInitialize function.


[Back] [Next]