Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!ucla-cs!cs.ucla.edu!stiber From: stiber@cs.ucla.edu (Michael D Stiber) Newsgroups: comp.lang.c Subject: Binary data file compatibility across machines Message-ID: Date: 23 Nov 90 21:46:00 GMT Sender: news@cs.ucla.edu (Mr. News) Organization: UCLA Machine Perception Laboratory Lines: 22 Nntp-Posting-Host: maui.cs.ucla.edu On different machines, the implementation of C data types is different. I forget what fixed types' lengths are, but I know that at least some of them may vary. I also know that doubles can have different encoding schemes (ie, IEEE vs. DEC). Then, there's little endian machines versus big endian ones. So, my question is this: Say you want to share data files among different machines. You also want to be able to use the same code on each machine. Therefore, you want to have either a uniform file format, or you want the code to be able to figure out what the file format is, and convert it to the native data type representation. Now, one alternative would be ASCII files --- this is guaranteed to work (assuming that you can get C on an IBM 3090 to write ASCII). However, in my application, ASCII would produce files that are way too huge --- I must use a binary format. So, is there an already-existing, standard solution to this problem of binary data file transfer? -- Michael Stiber stiber@cs.ucla.edu ...{ucbvax,ihpn4}!ucla-cs!stiber UCLA Computer Science Dept.