From: antirez <antirez@invece.org>
To: "Brenneke, Matthew Jeffrey (UMR-Student)" <mbrennek@umr.edu>
Cc: "'H. Peter Anvin'" <hpa@zytor.com>,
"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: Re: Yet another design for /proc. Or actually /kernel.
Date: Thu, 8 Nov 2001 01:20:51 +0100 [thread overview]
Message-ID: <20011108012051.C568@blu> (raw)
In-Reply-To: <6CAC36C3427CEB45A4A6DF0FBDABA56D59C91D@umr-mail03.cc.umr.edu>
In-Reply-To: <6CAC36C3427CEB45A4A6DF0FBDABA56D59C91D@umr-mail03.cc.umr.edu>; from mbrennek@umr.edu on Wed, Nov 07, 2001 at 03:13:25PM -0600
On Wed, Nov 07, 2001 at 03:13:25PM -0600, Brenneke, Matthew Jeffrey (UMR-Student) wrote:
> /dev/hda1 /home/mbrennek/stuff\040and vfat rw 0 0
[snip]
>
> Are you refering to the 040?
This works but, if /proc will really be replaced, another
idea can be to organize the stuff to get something of more
coherent than:
value1a value1b value1c
value2a value2b value2c
that's more human readable than machine parsable.
Something that can fix both the problems (quoting and format) is
the following:
put every string inside () and only quotes ( and ) with \
and quotes \ itself with \\, than use brackets to delimit
string _and_ provide information about the format:
((dev/hda1)(/home/mbrennek/stuff and)(vfat)(rw)(0)(0))
((/dev/hda2)(/var/tmp)(ext2)(rw)(0)(0))
and so on. With a simple parser you get a safe delimiter
for a single element and you know that there are two "objects"
of 6 elements.
An extension may be to use the first row to describe the
elements inside every object. After this the output of
/proc/mounts will be:
((device)(mountpoint)(type)(option)(dump)(fsck))
((dev/hda1)(/home/mbrennek/stuff and)(vfat)(rw)(0)(0))
((/dev/hda2)(/var/tmp)(ext2)(rw)(0)(0))
Good userspace software will never fail if you add more information.
If you need to change the format of something it's just possible
to add a new field and leave the old one for some time for backward
compatibility.
With some simple extension you can add comments or the ability
to redefine the fileds description for the next elements.
With the last improvments it looks like:
((type)(field0)(field1)...(fieldN))
/proc/mounts will be:
((rem)(mounted filesystems))
((format)(device)(mountpoint)(type)(option)(dump)(fsck))
((data)(dev/hda1)(/home/mbrennek/stuff and)(vfat)(rw)(0)(0))
((data)(/dev/hda2)(/var/tmp)(ext2)(rw)(0)(0))
((rem)(number of filesystems mounted))
((format)(mount_count))
((data)(2))
Last fix can be to surround all this with (), to detect
truncated outputs, since it seems that often the /proc outputs
can only use one page.
It looks a bit too complex, but actually it's very simple to
generate and parse. Expecially if someone release a "standard"
userspace library to parse it.
I'm sure all here already thought at something like it, and
probably there is a good reason to do it different, sorry if I
missed the point.
regards,
Salvatore
next prev parent reply other threads:[~2001-11-08 0:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-07 21:13 Yet another design for /proc. Or actually /kernel Brenneke, Matthew Jeffrey (UMR-Student)
2001-11-08 0:00 ` H. Peter Anvin
2001-11-08 0:20 ` antirez [this message]
2001-11-08 0:32 ` H. Peter Anvin
2001-11-08 0:54 ` David Ford
2001-11-08 1:10 ` antirez
2001-11-08 1:26 ` H. Peter Anvin
2001-11-08 1:51 ` antirez
2001-11-08 0:44 ` Stephen Satchell
2001-11-08 1:04 ` antirez
2001-11-08 0:55 ` Jonathan Lundell
2001-11-08 3:07 ` Stuart Young
[not found] <w_knop@hotmail.com>
2001-11-07 19:41 ` William Knop
2001-11-08 0:27 ` John Levon
2001-11-08 8:56 ` Erik Hensema
2001-11-08 10:00 ` Remco Post
2001-11-09 16:44 ` Ricky Beam
2001-11-12 13:31 ` Horst von Brand
2001-11-12 14:31 ` Martin Dalecki
-- strict thread matches above, loose matches on Subject: below --
2001-11-07 19:09 Erik Hensema
2001-11-07 19:27 ` Alan Cox
2001-11-07 19:42 ` Daniel R. Warner
2001-11-07 22:35 ` Allen Campbell
2001-11-07 20:58 ` H. Peter Anvin
2001-11-07 21:19 ` Justin A
2001-11-07 23:44 ` Rusty Russell
2001-11-08 0:35 ` Stephen Satchell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011108012051.C568@blu \
--to=antirez@invece.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbrennek@umr.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox