Search

Text Configuration files and XML

0 views

Configuration files are a problem for both operating systems and applications. Where do you keep them, how are they structured? Traditionally, Unix systems used text files with wildly varying internal structures, and Windows used either binary data or ".ini" text files (in this sense, "binary" is used for anything that you can't access directly with a simple text editor). More recently, Windows abandoned .ini files in favor of a binary central registry. The benefits of using a simple text format for configuration files should be obvious: nothing to learn (assuming that you can figure out WHAT to edit), and far more robust - no internal pointers to get screwed up, etc. The downside is that reading these files is slower, but realistically that is almost insignificant. There is also the annoyance of converting any required binary values to and from text, but again, that shouldn't be anything that really slows down the reading or writing. However, the ease of editing can be seen as a disadvantage also: if a proprietary tool is necessary for accessing the files, you can impose consistency checks and possibly avoid the introduction of garbage. I lean toward text files. It is possible to provide validation tools that CAN be used, and even SHOULD be used under ordinary circumstances, while leaving the ability to directly edit raw text when circumstances are not ordinary. A good example of that philosophy is the "visudoers" command (see If we look carefully, it's easy enough to find the home page setting there: &nbsp&nbsp&nbsp <key>WWWHomePage</key> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <dict> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <key>ic-data</key> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <string>http://www.pcunix.com/index.html</string> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp </dict> and, of course, many other settings and preferences. Every Mac OS X app uses XML property lists too; see APLawrence.com A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

Suggest a Correction

Found an error or have a suggestion? Let us know and we'll review it.

Share this article

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!