I agree that it would be stupid *not* to have an ASCII proc.
But why not make a machine-readable /proc as well ?
>
> Handling spaces and newlines is easy enough - see the patches from Al
> Viro, for example.
Obviously none of you have parsed something like:
[albatros:joe] $ cat /proc/mdstat
Personalities : [raid0] [raid1]
read_ahead 1024 sectors
md0 : active raid1 hdc1[1] hda1[0]
51264 blocks [2/2] [UU]
md1 : active raid1 hdc5[1] hda5[0]
10240128 blocks [2/2] [UU]
md2 : active raid0 hdc7[1] hda6[0]
6661184 blocks 64k chunks
unused devices: <none>
[albatros:joe] $
Now this isn't even bad - the fun begins when a resync is running, when
mdstat contains *progress meters* like "[====> ] 42%". While being
nicely readable for a human, this is a parsing nightmare. Especially
because stuff like this changes over time.
The worst thing is, that you'll often see that your parser isn't strict
enough, and therefore won't fail loudly, but rather "mis-parse" the "GUI"
that somehow got put into /proc.
I think it's great to put these things in /proc, but not having a machine
readable form too is stupid, especially because this could be done with
*no* harm to the existing interface, and with very little code.
-- ................................................................ : jakob@unthought.net : And I see the elder races, : :.........................: putrid forms of man : : Jakob Østergaard : See him rise and claim the earth, : : OZ9ABN : his downfall is at hand. : :.........................:............{Konkhra}...............: - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/