Dprogramming.com - The D Programming Language [archived content]
Directory

Home
News
Wiki
Entice Designer
DCode editor
Linkdef
bintod
Tutorial
D FAQ
Code
    bintod
    DFL GUI
    D irclib IRC
    fileprompt
    ini files
    Linkdef
    list linked list
    mtext
    Splat sockets
    trayicon
    wildcard
Contact
Paste
Links

ini.d 0.5

Portable module for reading and writing INI files.
Documentation is now available online.

Download INI Library ini.d.

Note: the Ini object does not keep the INI file open at all times. If a relative path is used, changing the current directory will cause the file to be saved in the new directory. The current directory can also change when using some common dialogs in Microsoft Windows.
Solution: use an absolute path. Functions in std.path and std.file can help:
if(!std.path.isabs(iniFileName)) iniFileName = std.path.join(std.file.getcwd(), iniFileName);

Update: the Ini object no longer saves in the destructor because if it is the garbage collector deleting it, some value or section object could have been destructed first, resulting in undefined behavior, such as an access violation.
Solution: save() before you exit your program or you will lose changes.

Copyright © 2004-2008 Christopher E. Miller