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

Tim Jansen
2001-11-04T12:28:11Z

On Sunday 04 November 2001 03:08, Jakob Østergaard wrote:
> Now, if established files in proc could just be stable, so that they would
> not change unless non-backwards-compatible information absolutely must be
> presented, that would be a major step in the right direction. Further, if
> we could find some acceptable compromise between human- and machine-
> readability, as has happened in the past...

The problem is that it is almost impossible to offer human-readable
interfaces that will be backward-compatible. As soon as you have a
well-formatted output, like /proc/partitions, you can not add a new field
without breaking user-space applications.
What you could do is to establish rules for files like /proc/partitions ("if
there are more than 4 space-separated alphanumeric strings per line in
/proc/partitions then ignore the additional fields"), but you won't find such
a rule that is useful for every file and still offers a nice human-readable
format. And it will be quite hard to be sure that everybody really sticks to
these rules. Alternatively you could use a semi-human-readable format like
XML, which several people have proposed, but it seemed like almost nobody
liked it.

IMHO there shouldn't be any 'presentation logic' in the kernel. If you need
the things in a human-friendly format, write a 3 line shell script:

for I in `ls -d /proc/partitions/*` ; do
echo `cat $I/major` `cat $I/minor` `cat $I/blocks` `cat $I/name`
done

bye...