Re: ARMS WAVING!!! Proposal to fix /proc dainbrammage.

david parsons (o.r.c@p.e.l.l.p.o.r.t.l.a.n.d.o.r.u.s)
26 Oct 1998 23:45:24 -0800


In article <linux.kernel.199810270021.TAA23532@jupiter.cs.uml.edu>,
Albert D. Cahalan <acahalan@cs.uml.edu> wrote:
>
>david parsons writes:
>> Albert D. Cahalan <acahalan@cs.uml.edu> wrote:
>>>Mark H. Wood writes:
>
>>>> (My take on this question is that programs should not be looking
>>>> in /proc at all; everything shown there should be available in
>>>> binary form via syscall,
>>>
>>> Oh yes! I really hate to parse /proc files. Parsing is not at all
>>> reliable, considering unexpected format changes and spelling fixes.
>>
>> That's not the fault of the /proc filesystem, but of the people
>> who promiscuously change the format of entries there without
>> considering the consequences.
>
>It is the fault of the /proc filesystem for being so tempting to reformat.
>Ugly files like /proc/*/stat are seldom damaged, while pretty files like
>/proc/*/status are often broken.

Any interface is tempting to reformat. It's still bad software
design, and it seems a really bad idea to strip kernel interfaces
just because badly-trained programmers can tweak them.

>We wouldn't have so many problems if all /proc files were just a series
>of space-delimited numbers without labels.

I don't know about that. I find it pretty easy to parse labelled
items, but have been repeatedly bitten by code (procinfo, code in
the procps suite) that makes assumptions about the format of the
space-delimited numbers.

____
david parsons \bi/ And, of course, I (and any ps-style tools I write)
\/ can easily read /proc/*/status without needing to
know undocumented arcane details...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/