Re: Suggested dual human/binary interface for proc/devfs

From: Stephen Harris (sweh@spuddy.mew.co.uk)
Date: Wed Apr 12 2000 - 15:33:00 EST


George Bonser (grep@shorelink.com) wrote:
: On Tue, 11 Apr 2000, Ed Carp wrote:

: > device=eth0;ip_address=192.168.201.116,netmask=255.255.255.0
: > device=eth1;ip_address=192.168.201.117,netmask=255.255.255.0

: device
: eth0;ip_address=192.168.201.116,netmask=255.255.255.0
: eth1;ip_address=192.168.201.117,netmask=255.255.255.0

: Now you have exactly the same thing as I wrote only:

Nope! These are two different things. Ed's original is *stateless*. All
the information is on one line. Your example has state in the parser - you
need to read it linearly to determine that the lines following are device
lines.

In Ed's example I can 'grep device=eth1' and find out all the information
about eth1. Not with yours.

: AS a matter of fact, the device= is redundant. Since it appears in every

Only in a limited number of cases, and only where one type of object is
ever reported on.

: device. It is no "easier" to parse.

Oh most definitely it _is_ easier to parse. Single line parsing is the most
trivial thing in the world to parse. Multi-line and _hierarchical_stateful_
parsers are the worst.

: As for code that already parses this format, think about any util that
: operates on bind or gated configuration files.

How do I do that in /bin/sh ?

-- 
                                 Stephen Harris
                 sweh@spuddy.mew.co.uk   http://www.spuddy.org/
      The truth is the truth, and opinion just opinion.  But what is what?
       My employer pays to ignore my opinions; you get to do it for free.      
  * Meeeeow ! Call  Spud the Cat on > 01708 442043 < for free Usenet access *

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:20 EST