comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com (Ted Dennison)
Subject: Re: config files proposal
Date: 3 Jun 2002 07:56:09 -0700
Date: 2002-06-03T14:56:09+00:00	[thread overview]
Message-ID: <4519e058.0206030656.34c424ff@posting.google.com> (raw)
In-Reply-To: wkznydwcm7.fsf@acm.org

Stephen Leake <stephen_leake@acm.org> wrote in message news:<wkznydwcm7.fsf@acm.org>...
> Darren New <dnew@san.rr.com> writes:
> > You need to specify where a file is written in the path. (API#6)
> > apparently only talks about reading files.
> 
> It should be written where it is found; I'll add that. Hmm, special
> case if it is a new file; write it to the first directory in the
> search path.

Perhaps I'm misunderstanding, but this sounds to me like you are
saying:

  1)  Users have very little control over where their config files get
written to.
  2)  There will be only one config file per system.
  3)  The facility will be dependent on the very system-dependant
feature of directory search paths.


I don't like the first two ideas at all, since they needlessly
restrict the funtionality. I could easily see loads of people who
would otherwise love to use the facility, forced to roll their own due
to problems with 1 and 2. Clients of the facility should be able to
read and write configurations to and from the directories and file
names of their choice.

The third issue I think requires a good deal of discussion before
being accepted. For one thing, it will prevent anyone from making a
portable implementation of the config file facility. It should also be
noted that if this facility's behavior depends on an
implementation-defined facility, then you are basicly saying that
(part of) this facility's behavior is implementation-defined. That in
turn means programs that use this facility are going to have
portability issues. In my mind, that's more serious than having
non-portable config files.

> > FF #3 I would disagree with. It limits having large items in the
> > config file format. 
> 
> Only if there is a maximum line length. I guess some text editors
> might impose one, but Ada.Text_IO doesn't.

Since it requires that the user supply a fixed-length buffer,
Ada.Text_IO effectively *does* impose a limit. It just lets you decide
what that limit is. :-)

> > Making key/value pairs terminated by a newline is specifying the
> > implementation. 

I'd disagree with this statement. It is (partially) specifying a file
format, but in no way specifies how the config file facility
implements it. The file format *has* to be part of the specification,
it can't be left as an "implementation detail".

Presumably this is just a first cut to get the "easy ones" ironed out,
before we start to agree on a file format. Right?

If so, a lot of this discussion will be rendered moot when the file
format is decided upon.

> > Question: Are keys case-sensitive?
> 
> Good point. I think I'll go with the Ada identifier model and say
> "no". 

I agree wholeheartedly, for the same reason.

> I'm not sure what your question is. Oh, I see; you want me to request
> key "foo", and if not found in ~/.bashrc then look in /etc/bashrc to
> find "foo". Hmm.
> 
> I guess we could add an "append_read_only" operation, that would read
> in a second file, and store it in a separate read-only tree. I like
> that. 

Perhaps it would be better to allow for some kind of "chaining" of
configuration objects? That way items not found in the first
configuration might be found in later ones.

In most of my projects that use configuration files, there are a set
of hard-coded defaults for all configuration values. That way if no
config files exist, we still have a reasonable set of defaults
defined. A client creating a "default" configuration object that is
loaded with values from the program at initialization time and chained
on the back would be one way of implementing this.

> > Question: Is the file closed (w.r.t. the OS) between the end of the
> > read and the start of the write?
> 
> Yes. Actually, I think the file is OS closed at the end of Open, after
> the data is read in.

*That* sounds like an implementation detail to me. Its a good idea
perhaps, but still an implementation detail.

> I'm planning on renaming the file to a backup name before writing it,
> for glitch protection.

Ditto

> base64 would be good for values that don't need to be user editable. I
> guess persistent storage for a large object (whether it is composite
> or not) could be supported that way. I'm not clear why that would be
> in a typical "config file". Hmm, maybe a pixel bitmap for an icon?

Motif's UIL did these as text. You define the colormap for each ASCII
character, then use the defined ASCII characters to draw the bitmap.
In the text buffer it looked a bit like ASCII art. The only big
drawback I saw was that the "art" value is destroyed if your bitmap
gets wider than your text editor.


-- 
T.E.D. 
Home     -  mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage -  http://www.telepath.com/dennison/Ted/TED.html



  parent reply	other threads:[~2002-06-03 14:56 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-02 16:07 config files proposal Stephen Leake
2002-06-02 21:29 ` Darren New
2002-06-02 22:00   ` Darren New
2002-06-02 22:16   ` Stephen Leake
2002-06-03  4:20     ` Darren New
2002-06-09 20:16       ` Stephen Leake
2002-06-10  1:33         ` Darren New
2002-06-10 12:35           ` Stephen Leake
2002-06-10 15:42             ` Darren New
2002-06-10 14:23           ` Georg Bauhaus
2002-06-03 14:56     ` Ted Dennison [this message]
2002-06-03 16:08       ` Darren New
2002-06-03 16:24         ` Jean-Marc Bourguet
2002-06-03 16:50           ` Darren New
2002-06-04 11:07             ` Preben Randhol
2002-06-04 19:55         ` Ted Dennison
2002-06-09 20:43           ` Stephen Leake
2002-06-09 20:39         ` Stephen Leake
2002-06-10  1:33           ` Darren New
2002-06-10 10:17             ` Preben Randhol
2002-06-09 20:29       ` Stephen Leake
2002-06-10  1:33         ` Darren New
2002-06-10 18:58         ` Ted Dennison
2002-06-11 18:11           ` Stephen Leake
2002-06-03 15:13     ` Preben Randhol
2002-06-04 15:41 ` Antonio Duran
2002-06-04 15:51   ` Darren New
2002-06-05 10:17     ` Antonio Duran
2002-06-05 14:31     ` Ted Dennison
2002-06-05 19:12   ` Syntactically correct spanish identifiers (Was: config files proposal) Jacob Sparre Andersen
2002-06-06  1:49     ` Robert Dewar
2002-06-07  8:07       ` Antonio Duran
2002-06-07 15:37         ` Robert Dewar
2002-06-09 20:54   ` config files proposal Stephen Leake
2002-06-10  1:33     ` Darren New
2002-06-10 12:40       ` Stephen Leake
2002-06-10 15:45         ` Darren New
2002-06-11 13:15           ` Ted Dennison
2002-06-11 16:36             ` Darren New
2002-06-12  7:40               ` Volkert Barr
2002-06-12 15:45                 ` Darren New
2002-06-13  8:17                   ` Volkert Barr
2002-06-13 13:20                   ` Ted Dennison
2002-06-13 13:38                 ` Georg Bauhaus
2002-06-11 13:09       ` Ted Dennison
2002-06-13 15:52     ` Georg Bauhaus
2002-06-04 17:06 ` Darren New
2002-06-09 21:01   ` Stephen Leake
2002-06-06  7:57 ` Volkert Barr
2002-06-06 10:04   ` sk
2002-06-06 11:33     ` Volkert Barr
2002-06-06 13:56       ` sk
2002-06-07  8:24   ` Volkert
2002-06-07  9:01     ` Jason King
2002-06-07 11:01       ` Preben Randhol
2002-06-07 17:06         ` Darren New
2002-06-07 17:13           ` Preben Randhol
2002-06-07 17:33             ` Darren New
2002-06-07 18:26               ` Preben Randhol
2002-06-09 21:08               ` Stephen Leake
2002-06-07 15:07       ` Volkert
2002-06-07 15:12       ` Ted Dennison
2002-06-09 21:16         ` Stephen Leake
2002-06-09 21:05   ` Stephen Leake
2002-06-13  9:08 ` Antonio Duran
2002-06-13 14:15   ` Stephen Leake
2002-06-13 21:04     ` Antonio Duran
2002-06-14 16:15       ` Stephen Leake
2002-06-13 18:38   ` Ted Dennison
  -- strict thread matches above, loose matches on Subject: below --
2002-06-14  0:19 Config_Files proposal Stephen Leake
2002-06-18 17:07 Stephen Leake
2002-06-18 21:55 ` Darren New
2002-06-19 16:11   ` Stephen Leake
2002-06-19 16:51     ` Darren New
2002-06-19 18:39       ` Stephen Leake
2002-06-19 19:48         ` Darren New
2002-06-20 14:03           ` Stephen Leake
2002-06-20 16:36             ` Darren New
2002-06-20 17:49               ` Jacob Sparre Andersen
2002-06-20 20:00                 ` Stephen Leake
2002-06-20 20:16                   ` Darren New
2002-06-20 20:45                     ` Stephen Leake
2002-06-21  2:06                     ` Ted Dennison
2002-06-21 12:55                       ` Marin David Condic
2002-06-24 13:20                         ` Stephen Leake
2002-06-21 15:29                       ` Darren New
2002-06-24 13:16                         ` Stephen Leake
2002-06-24 15:06                           ` Darren New
2002-06-24 17:09                             ` Stephen Leake
2002-06-24 17:57                               ` Darren New
2002-06-24 18:53                                 ` Stephen Leake
2002-06-24 21:24                                   ` Darren New
2002-06-29  3:15                                   ` Ted Dennison
2002-06-28 23:21                           ` Randy Brukardt
2002-06-29  3:01                             ` Ted Dennison
2002-07-01 20:58                               ` Randy Brukardt
2002-07-02  0:31                                 ` Ted Dennison
2002-07-02  4:43                                   ` Randy Brukardt
2002-07-05 21:51                                     ` Robert I. Eachus
2002-06-20 19:54               ` Stephen Leake
2002-06-19  6:53 ` Dr. Michael Paus
2002-06-19 15:18   ` Ted Dennison
2002-06-19 15:08 ` Ted Dennison
2002-06-19 16:18   ` Robert I. Eachus
2002-06-19 16:53     ` Darren New
2002-06-19 18:22       ` Stephen Leake
2002-06-20 13:12         ` Marin David Condic
2002-06-24 13:09           ` Stephen Leake
2002-06-24 15:08             ` Darren New
2002-06-24 17:13               ` Stephen Leake
2002-06-24 17:59                 ` Darren New
2002-06-24 19:04                   ` Stephen Leake
2002-06-24 21:29                     ` Darren New
2002-06-25 12:52                     ` Georg Bauhaus
2002-06-25 12:45                 ` Georg Bauhaus
2002-06-19 21:32       ` Georg Bauhaus
2002-06-19 18:20     ` Stephen Leake
2002-06-21 20:04       ` Robert I. Eachus
2002-06-24 13:39         ` Stephen Leake
2002-06-19 16:48   ` Marin David Condic
2002-06-20 13:04     ` Georg Bauhaus
2002-06-20 13:53       ` Marin David Condic
2002-06-20 14:19     ` Stephen Leake
2002-06-20 15:37     ` Ted Dennison
2002-06-19 18:15   ` Stephen Leake
2002-06-20  1:35     ` Ted Dennison
2002-06-20 14:10       ` Stephen Leake
2002-06-20 20:50         ` Jacob Sparre Andersen
2002-06-20 20:58           ` Stephen Leake
2002-06-21  2:21           ` Ted Dennison
2002-06-24 13:22             ` Stephen Leake
2002-06-20  1:37     ` Ted Dennison
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox