Re: [PATCH] 2.5 PROPOSAL: Replacement for current /proc of shit.

Jonathan Lundell
2001-11-05T16:51:00Z

At 11:12 AM +1100 11/5/01, Rusty Russell wrote:
>Firstly, do not perpetuate the myth of /proc being "human readable". (Hint:
>what language do humans speak?) It supposed to be "admin readable" and
>"machine readable".

That's the key observation, seems to me. In our development, we've
adopted a standard of tagged values, where a single-value file is
tagged by its name, and multiple-value files have a tag:value per
line (where value might be an n-tuple).

The result is easy to parse for userland code that needs the values
and relatively easy (because ASCII and consistent) for admins to
read. A pretty-printer provides an interface for mere humans.

I suppose one could add typing information as well, but it seems to
me that a reader of /proc/stuff is either completely ignorant of the
content (eg cat), and typing is irrelevant, or it knows what's there
(eg ps) and typing is redundant, as long as there are unambiguous
tags.

I think of the tagged list of n-tuples as a kind of ASCII
representation of a simple struct. One could of course create a
general ASCII representation of a C struct, and no doubt it's been
done innumerable times, but I don't think that helps in this
application.

Of course, one tagged value can be "version"....
--
/Jonathan Lundell.