Re: Yet another design for /proc. Or actually /kernel.

Allen Campbell (lkml@campbell.cwx.net)
Wed, 7 Nov 2001 15:35:34 -0700


On Wed, Nov 07, 2001 at 02:42:48PM -0500, Daniel R. Warner wrote:
> Erik Hensema wrote:
>
> > - Multiple values per file when needed
> > A file is a two dimensional array: it has lines and every line
> > can consist of multiple fields.
> > A good example of this is the current /proc/mounts.
> > This can be parsed very easily in all languages.
>
>
> > No need for single-value files, that's oversimplification.
> <snip>
>
>
> This is fine for reading, but it makes it harder for humans to change
> values in /proc - eg, echo 0 > /proc/sys/net/ipv4/tcp_ecn
>

'Multiple value' files can be made easy to 'write'. The only
requirement is each 'field' in the file have a unique label. Then
it's a common associative array, requiring some generic filesystem
write magic to handle the input:

echo "label:1" > /proc/...

The 'generic write magic' would require (at least, without even
more magic) that all /proc files conform to the schema. This is
probably a _good_ thing.

-- 
  Allen Campbell       |  Lurking at the bottom of the
  allenc@verinet.com   |   gravity well, getting old.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/