Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!labrea!csli!poser From: poser@csli.Stanford.EDU (Bill Poser) Newsgroups: comp.lang.c Subject: Re: binary data files Summary: Disadvantage of ASCII data files Message-ID: <8758@csli.Stanford.EDU> Date: 1 May 89 02:39:47 GMT References: <10946@bloom-beacon.MIT.EDU> <12546@ut-emx.UUCP> Sender: poser@csli.Stanford.EDU (Bill Poser) Reply-To: poser@csli.stanford.edu (Bill Poser) Organization: Center for the Study of Language and Information, Stanford U. Lines: 11 I agree that in many cases it is desirable to use ASCII data files, but in some situations binary is better. One such situation is when you need to know how many items are in the file before you read it (say to allocate storage). If the data is binary you just stat the file and divide by the item size. But if you use ASCII data there won't be a fixed item size, unless you go to the trouble of arranging fixed field widths (which also may waste a lot of space), or arrange to write a header containing the number of items, which is impractical in some situations.