Messages in this thread | | | Date | Tue, 29 Feb 2000 13:36:14 -0500 (EST) | From | "Mark H. Wood" <> | Subject | Re: What /proc should contain [was: /proc/driver/microcode] |
| |
On Mon, 28 Feb 2000, Patrick Spinler wrote: > Preface this with the obligatory "I am not a kernel hacker. If this > message is stupid, just ignore me."
No, it's worth discussing.
> Regarding parsing /proc files, has anyone thought of a file format which > contains a parsing specification ? For example a scanf format string. > > Eg: > > $ cat /proc/somefile > %d %d %f %s > 12 45 8.4 Some String
If the data are to be self-describing then we also need to know what each one is. So:
$ cat /proc/somefile rate limit average eventname %d %d %f %s 12 45 8.4 Some String
But now look at that first line. Those tags must be fixed text or we get all the same old respelling problems. So why didn't we just have
$ cat /proc/something/rate 12 $ cat /proc/something/limit 45 $ cat /proc/something/average 8.4 $ cat /proc/something/eventname Some String
I had to know that rate, limit, and average are numbers, and average is a float, and eventname is a string, in order to use them, so now the formats are irrelevant.
-- Mark H. Wood, Lead System Programmer mwood@IUPUI.Edu "Where's the kaboom? There was supposed to be an Earth-shattering kaboom!" -- Marvin Martian, 01/01/2000 00:00:00
- 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/
| |