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 01:35:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!3bae8248!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: A standard package for config files is needed References: <3CF5D7AC.975B0DB3@cs.tu-berlin.de> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.14.79 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr14.news.prodigy.com 1022747673 ST000 12.234.14.79 (Thu, 30 May 2002 04:34:33 EDT) NNTP-Posting-Date: Thu, 30 May 2002 04:34:33 EDT Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: Q[R_@SVGXZUWSVPXN[O@_WH@YR_B@EXLLBWLOOAFQATJUZ]CDVW[AKK[J\]^HVKHG^EWZHBLO^[\NH_AZFWGN^\DHNVMX_DHHX[FSQKBOTS@@BP^]C@RHS_AGDDC[AJM_T[GZNRNZAY]GNCPBDYKOLK^_CZFWPGHZIXW@C[AFKBBQS@E@DAZ]VDFUNTQQ]FN Date: Thu, 30 May 2002 08:34:33 GMT Xref: archiver1.google.com comp.lang.ada:24994 Date: 2002-05-30T08:34:33+00:00 List-Id: > 2) a config file should store information in plain ASCII, so a > user can easily modify them by hand! > 3) the config file should be simple organized: > - All entries sould be of the form "scope.key := value" > - Ada-like comment blocks In a particular Windows program of mine the user can modify the color settings (via the usual Windows color dialog), and the program will save his preferences in the registry. This is done with: type Shelf_Palettes is record ... procedure Stash_Palette is new Claw.Registry.Write(Shelf_Palettes); ... Stash_Palette(Claw.Registry.HKEY_CURRENT_USER, "Software\Decision Aids\Shelves", "Palette", Saved_Palette); That's pretty simple. It appears to me you are suggesting that instead I should write code to convert every element of Shelf_Palettes to a string and write it out preceded with some suitable, human understandable, "name=", and also write code to read such stuff back in, complete with error handling when the user has botched up that text file. That would be a tremendous regression and I can't imagine anybody doing it. Why should the config file be an easily edited ASCII file? Did everyone enjoy editing .ini files in old Windows so much? How often in current Windows programs do users modify the config by doing things in the app (like the color palette above), and how often do Windows users change a configuration by using regedit? Considering how often real users should need to edit a config file independently of the app or its Install program, I'm inclined to suggest it would be easier to just read/write records in binary and tell the user to use "debug" if he needs to modify them manually! There are also the questions of where the config file is stored, and how multiple users of the same machine can have different configurations. The Windows registry certainly is an all too common failure point and as a sort of parallel file system it's painful to backup/restore or uninstall programs, but improvements in config files are not, I suggest, to be found in better syntaxes for an ASCII text file.