binary data files
mcdonald at uxe.cso.uiuc.edu
mcdonald at uxe.cso.uiuc.edu
Tue May 2 00:08:00 AEST 1989
>.... Believe me, ascii is better:
> ...
>Bad things [WRT ascii data file]:
>
>1. Files take a bit longer to read in
More than a bit longer. I see no reason not to standardize on a
standard binary format and use that for data interchange:
8 bit bytes, two's complement. On more-than-eight-bit byte
machines, pad with zeroes. Your choice of endianness. For example,
TeX produces a well-defines .dvi file as output, and Metafont
produces standard .gf files, all of which are binary. I have
no difficulty copying these between DEC-20's, IBM-PCs and VAX's
(which are the same for this), and big-endian RISC machines.
Dec-20s have 36 bit words.
Screwing around with endianness etc., repacking bytes, etc., is
a lot faster than ASCIIfication, especially in C.
Doug McDonald
More information about the Comp.lang.c
mailing list