Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!deimos.cis.ksu.edu!uxc!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: binary data files Message-ID: <225800166@uxe.cso.uiuc.edu> Date: 1 May 89 14:08:00 GMT References: <10946@bloom-beacon.MIT.EDU> Lines: 21 Nf-ID: #R:bloom-beacon.MIT.EDU:10946:uxe.cso.uiuc.edu:225800166:000:777 Nf-From: uxe.cso.uiuc.edu!mcdonald May 1 09:08:00 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