From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103885,20ac8f08b884ba5 X-Google-Attributes: gid103885,public X-Google-Thread: 1094ba,10f7c56bf397ed71 X-Google-Attributes: gid1094ba,public X-Google-Thread: 111c93,20ac8f08b884ba5 X-Google-Attributes: gid111c93,public From: Richard Maine Subject: Re: Forcing 32-bit integers and math Date: 1998/10/15 Message-ID: #1/1 X-Deja-AN: 402574416 References: <36255A0B.4C40@wizard.com> <703ulq$68a@news3.newsguy.com> <705c5g$pl@bgtnsc01.worldnet.att.net> Organization: NASA Dryden Newsgroups: comp.lang.fortran,comp.graphics.visualization,comp.os.linux.alpha "James Giles" writes: > I would be surprised if there were only a 4-byte record length on > UNIX platforms.... > > If UNIX platforms typically use only 4 bytes for this, they must be > limiting records to lengths of 64K(16 bit length counts). And since > they use bytes as their unit of length, that's 64K bytes = 16K (32-bit) > words. Is that what they do? No. Definitely not. I've regularly write longer records that that. As far as I'm aware, both Gren and you are right. The record header is only 4 bytes. But there is also a 4 byte record trailer. This is almost synonymous with your record hearder that has 2 4-bytes words. The difference is just at the beginning and end of the file. I.E. If H is the header and T the trailer, you should see H...TH...TH...TH...T instead of (calling T and H the coressponding 2 parts of your header). TH...TH...TH...TH... P.S. I *HAVE* seen a non-unix system (Elxsi) that used only headers with no trailer or other way to record the size of the preceding record. Backspace even worked - wanna know how? It kept track of the current record number and, if you wanted to backspace, it rewound the file and skipped N-2 records. This made some things "interesting". One nice thing about the Elxsi headers, though, was that they kept one bit for a record continuation mark. Thus you could have arbitrarily long records, even with just a 2-byte header. (The header size was user-selectable and the system remembered which size each file had). This if you had a file with mostly short records, you could use a 2-byte (or even 1-byte) header to keep the overhead down without ruling out the possibility of the occasional long record. The long records just ended up using multiple headers with the record continuation bit set. Lets see, in the old IBM mainframe days, I thing we'd have called that a segmented record, but I could misrecall the terminology. -- Richard Maine maine@altair.dfrc.nasa.gov