Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!tut.cis.ohio-state.edu!att!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.lang.c Subject: Re: binary data files Message-ID: <8396@chinet.chi.il.us> Date: 7 May 89 05:16:52 GMT References: <10946@bloom-beacon.MIT.EDU> <12546@ut-emx.UUCP> <8758@csli.Stanford.EDU> <11021@bloom-beacon.MIT.EDU> <14301@bfmny0.UUCP> <8815@csli.Stanford.EDU> <1821@ubu.warwick.UUCP> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Organization: Chinet - Public Access Unix Lines: 23 In article <1821@ubu.warwick.UUCP> geoff@cs.warwick.ac.uk (Geoff Rimmer) writes: >My "rules" for choosing whether I use a binary file, or an ASCII file >for storing data are as follows: >(1) If I am storing a file of structs, I always use binary. This >is because it is faster, and because it makes the code easier to write >and understand. [...] >I don't believe you can say "always use ascii files" - it just ain't >good enough for some applications. I'm surprised that no one has mentioned this yet, but writing binary data or structs to disk files results in a file which may require conversion for use by another machine. This becomes a serious problem in a networked environment where it may not be apparent which machine created the file or when multiple machines need simultaneous access. It is not that unlikely that your next machine upgrade will consist of adding more hosts on a net with access to the current files. Do you want to bet that they will have the same byte order, word size, and struct padding? Les Mikesell