Path: utzoo!utgpu!water!watmath!clyde!gwu From: gwu@clyde.ATT.COM (George Wu) Newsgroups: comp.arch Subject: Re: RISC data alignment Summary: How about an intermachine binary format? Keywords: alignment 68000 8086 Message-ID: <21152@clyde.ATT.COM> Date: 1 Feb 88 18:29:44 GMT References: <2635@calmasd.GE.COM> <6280@ccv.bbn.COM> <3120@phri.UUCP> Reply-To: gwu@clyde.UUCP (George Wu) Organization: AT&T Bell Laboratories, Whippany NJ Lines: 25 Roy Smith posts: > In article <2635@calmasd.GE.COM> gjo@calmasd.UUCP (Glenn Olander) writes: > > it would seem that if that C structure were written out to a file, it could > > only be read properly by a machine of the same type as that which wrote it. > > Why is this a surprise? Lots of things prevent you from writing a > structure on one machine and reading it on another: byte (and bit) order, > padding requirements, word length, floating point formats, etc. If you > want to be able to have your file read by another machine type, you > shouldn't be writing binary structures. Use ascii, or hton(), or XDR, or > something like that. Okay, so what formats are used? I know X-Windows has some such convention to transmit binary data across the network, ie. a client and a server on different machines. What format do they use? (Hopefully, Roy will expand upon hton() and XDR. I think ASCII is self-explanatory.) I'm not sure what C-MU's Andrew system (consisting of Microvax-IIs, Sun-3s, Sun-2s, and mostly IBM RT/PCs) uses across the network, but for transportable files, a base 64 ASCII file is used. Any other bright ideas? George rutgers!clyde!gwu