From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,47bc849aad30d586 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-30 12:59:01 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news-hog.berkeley.edu!ucberkeley!logbridge.uoregon.edu!news.net.uni-c.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: A standard package for config files is needed Date: Thu, 30 May 2002 21:58:36 +0200 Organization: Centre for Chaos and Turbulence Studies, Niels Bohr Institute Message-ID: <3CF6846C.3544EB21@nbi.dk> References: NNTP-Posting-Host: alf.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.net.uni-c.dk 1022788739 28306 130.225.212.55 (30 May 2002 19:58:59 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Thu, 30 May 2002 19:58:59 +0000 (UTC) X-Mailer: Mozilla 4.78 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: fo,da,no,sv,is,de,fr,en Xref: archiver1.google.com comp.lang.ada:25032 Date: 2002-05-30T21:58:36+02:00 List-Id: Preben Randhol wrote: > On the GtkAda list there has been some discussion on making a standard > package for reading/writing configuration files. As most programs need > this it would be very nice with a small, platform independant, robust > but easy to use package. Yes. If we take a look at the specification (API) side of things first, then I think such a package would need: + (generic?) routines to read and write primitive Ada types from/to the configuration data. + The data should be stored as key-value pairs, possibly embedded in in a hierarchical system of sections. + A routine for syncronising the configuration data with the external storage in case that is relevant. + An option to select another source/target than the default storage of the configuration data. Are there more things we should keep in mind, when discussing the specification for a simple configuration management package? If we take a look at the implementation (file format) side of things, there are a few things worth noting: + Using the same file format on all systems makes it slightly easier to write documentation for programs using the package (unless the package includes a function returning the file format documentation). + Using a text based file format makes it easier to copy configuration files between different platforms. + Using a text based file format allows users to use independent tools (for example text editors) to modify the configuration. + Using a platform specific binary format may make access to the configuration data faster. + Using typical (or standard) configuration management for the individual platforms, will allow users to configure programs in a way they are familiar with. And since the specification and implementation sides of things can be relatively independent of each other, nothing prevents us from writing more than one implementation, so everybody can get to use their choice of configuration files (also for programs written by other Ada programmers ;-). Jacob -- "Those who profess to favor freedom and yet depreciate agitation, are people who want crops without ploughing the ground; they want rain without thunder and lightning; they want the ocean without the roar of its waters." -- Frederick Douglas