/proc file-system

Richard B. Johnson (root@analogic.com)
Fri, 21 Feb 1997 16:08:24 -0500 (EST)


Problems with the compatibility of utilities that use the /proc file-
system for their input may be mitigated if any fields that are added,
are put at the end of existing fields.

The developers should understand that these fields are read either by
humans or by programs that use scanf() and friends. Therefore, we should
use white-space for delimiters and stay away from ":,=$&(#@*", etc.

If a user wants a "pretty" presentation, a user can write a program
to do this. Here is one of the already "pretty" /proc file-system
files.

processor : 0
cpu : 586
model : Pentium 75+
vendor_id : GenuineIntel
stepping : 12
fdiv_bug : no
hlt_bug : no
fpu : yes
fpu_exception : yes
cpuid : yes
wp : yes
flags : fpu vme de pse tsc msr mce cx8
bogomips : 66.15

I suggest:

processor 0
cpu 586
model Pentium 75+
vendor_id GenuineIntel
stepping 12
fdiv_bug no
hlt_bug no
fpu yes
fpu_exception yes
cpuid yes
wp yes
flags fpu vme de pse tsc msr mce cx8
bogomips 66.15

If someone added a new field, they would put it after the existing ones,
i.e., after bogomips.

With entries that have everything on one line, the same applies. Put the
new entry after the existing ones. If this was done, old code would not
break when updates were made. The old code just wouldn't be able to use
or display the new stuff.

Just my 2p

Cheers,
Dick Johnson
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard B. Johnson
Project Engineer
Analogic Corporation
Voice : (508) 977-3000 ext. 3754
Fax : (508) 532-6097
Modem : (508) 977-6870
Ftp : ftp@boneserver.analogic.com
Email : rjohnson@analogic.com, johnson@analogic.com
Penguin : Linux version 2.1.26 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-