From: Richard Maine <maine@altair.dfrc.nasa.gov>
Subject: Re: Forcing 32-bit integers and math
Date: 1998/10/15 [thread overview]
Message-ID: <uezpaxr22v.fsf@altair.dfrc.nasa.gov> (raw)
In-Reply-To: 705c5g$pl@bgtnsc01.worldnet.att.net
"James Giles" <jamesgiles@worldnet.att.net> 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
next prev parent reply other threads:[~1998-10-15 4:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <YQsT1.507$525.1552696@ptah.visi.com>
[not found] ` <6vt65k$5hp$1@walter-fddi.cray.com>
1998-10-14 4:00 ` Forcing 32-bit integers and math G. Hugh SONG
1998-10-14 4:00 ` Greg Lindahl
1998-10-15 4:00 ` Jeff Drummond
1998-10-15 4:00 ` H.W. Stockman
1998-10-15 4:00 ` Greg Lindahl
1998-10-15 4:00 ` James Giles
1998-10-15 4:00 ` Greg Lindahl
1998-10-16 4:00 ` Jeff Drummond
1998-10-16 4:00 ` James Giles
1998-10-15 4:00 ` Richard Maine [this message]
1998-10-18 4:00 ` James Giles
1998-10-15 4:00 ` Jeff Drummond
1998-10-15 4:00 ` Toon Moene
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox