type and size of bit-fields

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Mar 22 02:17:06 AEST 1991


In article <1991Mar21.021023.25615 at athena.mit.edu> scs at adam.mit.edu writes:
> The moral: DON'T USE BINARY DATA FILES.

Binary files often increase not only efficiency, but security and
reliability. What am I referring to? Compilations.

There are examples of this other than language compilations. I'm working
on a system program, shuctld, which takes a readable configuration file,
typically /etc/shu.conf, compiles it into /etc/shu.cc, and then uses
/etc/shu.cc. This saves up to a few seconds of parsing and service-host
lookup time at the beginning of every network connection.

Not only that, but if someone makes a syntax error in /etc/shu.conf,
shuctld will blare a few warnings in various places and continue using
the old /etc/shu.cc. You know what happens if you mess up /vmunix and
then reboot? That can't happen with /etc/shu.conf.

shuctld automatically checks whether /etc/shu.cc is newer than
/etc/shu.conf, so you don't have to worry about the files getting out of
sync. It can also check /etc/shu.cc against its own executable, so that
you don't even have to worry if the compiled format changes.

Now why shouldn't shuctld use an easy-to-parse, reliable binary file,
rather than a text file that users will invariably trash?

---Dan



More information about the Comp.lang.c mailing list