Binary vs. text files (was Re: sizeof(struct) and padding)

Anton Rang rang at cs.wisc.edu
Sun Oct 21 08:36:15 AEST 1990


In article <1990Oct20.003222.25439 at athena.mit.edu> scs at adam.mit.edu (Steve Summit) writes:
>My $64,000 question is: why are so many poor souls condemned to
>try to read and write binary data files?

  My $0.02 answer is: Using a binary (or other fixed-length) format
makes random access easy; and allocating records large enough to
handle the largest textual representation of the data may be
impractical.  (OK, so you could do the equivalent of uuencode on the
data and it wouldn't blow up too much.)

  For sequential files where space and speed aren't issues, text
formats are great; otherwise, a binary format is probably good.

  All IMHO, of course.

	Anton
   
+---------------------------+------------------+-------------+
| Anton Rang (grad student) | rang at cs.wisc.edu | UW--Madison |
+---------------------------+------------------+-------------+



More information about the Comp.lang.c mailing list