Re: Tagged files in /proc

Albert Cahalan (albert@ccs.neu.edu)
Wed, 28 Feb 1996 16:53:04 -0500 (EST)


>> Why make this so hard for the kernel and apps?
>>
>> Always quote filenames like this: /my filename has a space/
>
> Yes, I like that one.
>
>> Numbers are always 0-padded hex: 00000B62
>> Memory sizes are given in allocation units, often 4k or 8k pages.
>> Space pad all strings - thus filenames are always padded to about 255.
>>
>> It would not be pretty, but it is still human readable.
>> It is much faster, and you can just use proper tools to read proc
>> information. I would say that /bin/cat is not a proper tool,
>> unless you are trying to debug a better tool.
>
> the whole point of /proc was that /bin/cat _WAS_ a proper tool.
> if you want to only use tools to read config info, just use /dev/kmem
> and rebuild without proc.

The points are kernel version independence and not suid to root.
You can also use /bin/cat in an emergency or when debugging.

> I personally like to cat /proc/status or /proc/cpuinfo or whatever.
> It is still machine readable, as well as humanly readable.

Sure, those files are simple and not speed critical.

I imagine you use top or ps to look at processes though, right?
I hope not 'cat /proc/*/* |less' or something.

Also, hex is so much more readable than decimal because you can
tell what power of 2 it fits into without calculation :-)
I really think hex is best because it is a good compromise between
decimal (readable but slow) and binary (only Linus can read it).
It is possible to print and read zero padded hex _very_ fast.