Re: procfs problems

Baldur Norddahl (bbn@dark.x.dtu.dk)
Thu, 17 Apr 1997 00:58:43 +0200 (MET DST)


On 16 Apr 1997, Stefan Monnier wrote:

> I know people love their good old text, ASCII if possible, so you can be sure
> it's only readable conveniently by humans who can understand english.
>
> Why in the world is 'cat /proc/cpuinfo' better than 'bin2text /proc/cpuinfo' ?
> All that text-printing stuff has nothing to do in the kernel anyway.

It is a lot easier to write a script or small program that reads the proc
files if they are in ascii format, since you need no documentation to do
so. Just cat the file and you have almost all information you need.

I could spawn the 'bin2text' program but then perfomance is going to
suck. If I don't want to spawn bin2text I need to store translation tables
inside my program, and thereby incresse the changes that my program wont
work with a future kernel. By using the ascii version I could ignore new
tags, and my program would produce sensible output even thou it hadn't
ever heard of a cyrix cpu before. It could simply print the tag value
instead of resulting to printing "unknown" becouse it have an outdated
translation table.

Baldur