RE: Yet another design for /proc. Or actually /kernel.

From: Jonathan Lundell (jlundell@pobox.com)
Date: Wed Nov 07 2001 - 19:55:59 EST


At 3:13 PM -0600 11/7/01, Brenneke, Matthew Jeffrey (UMR-Student) wrote:
> >> - Multiple values per file when needed
>>> A file is a two dimensional array: it has lines and every line
>>> can consist of multiple fields.
>>> A good example of this is the current /proc/mounts.
>>> This can be parsed very easily in all languages.
>>> No need for single-value files, that's oversimplification.
>>>
>
>>Actually, /proc/mounts is currently broken, and is an excellent
>>example of why the above statement simply isn't true unless you apply
>>another level of indirection: try mounting something on a directory
>>the name of which contains whitespace in any form (remember, depending
>>on your setup this may be doable by an unprivileged user...)

If [tag plus] multiple values are allowed on a line, the field
separation needs to be unambiguous. So quoting/escaping is required
in some cases. Spaces are common enough in a value that white space
maybe doesn't make a very good field separator.

Or just quote all strings (and escape quotes). Interpret values as C
would, 0x for hex, "... for strings, and so on for floating point,
octal, &c. Heck, you could even have typing (3UL) or casts, though
that's probably going too far.

-- 
/Jonathan Lundell.
-
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/



This archive was generated by hypermail 2b29 : Wed Nov 07 2001 - 21:00:37 EST