Path: utzoo!attcan!uunet!husc6!rice!sun-spots-request From: marks@sun.com (Mark Stein) Newsgroups: comp.sys.sun Subject: Re: Can I force a Sun 4 *NOT* to align elements on 16 bit boundaries Message-ID: <8812152248.AA22277@ferne.sun.com> Date: 22 Dec 88 19:38:47 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 15 Approved: Sun-Spots@rice.edu Original-Date: Thu, 15 Dec 88 14:48:41 PST X-Sun-Spots-Digest: Volume 7, Issue 74, message 10 of 16 > I think the best way out is to write a routine to do the I/O on your file, > treating it as a byte stream, and fill in or read out of the struct > aligned how the host machine wants it. Now that should port .... ;-)! Hmmm. This sounds suspiciously like XDR. Designed for precisely this purpose. Portable, too. Hint1: Look at xdrstdio_create(). This attaches an XDR data stream to a stdio file pointer. Hint2: rpcgen can be used to generate XDR routines for your data types independent of whether they will be used in RPC requests. --Mark Stein Sun Microsystems, Distributed System Software