Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: "James Giles" <jamesgiles@worldnet.att.net>
Subject: Re: Forcing 32-bit integers and math
Date: 1998/10/15	[thread overview]
Message-ID: <705c5g$pl@bgtnsc01.worldnet.att.net> (raw)
In-Reply-To: 703ulq$68a@news3.newsguy.com


Greg Lindahl wrote in message <703ulq$68a@news3.newsguy.com>...
...
>Right. On Unix platforms, which is what this fellow is using, there is
>a simple convention: a 4-byte delimiter giving the length of the
>record in bytes. I've yet to meet an alternate Fortran compiler on a
>Unix box which did anything different; the only incompatibility I've
>seen springs from the desire to support 64 bits, and between
>platforms, Cray's use of a word length instead of a byte length.

I would be surprised if there were only a 4-byte record length on
UNIX platforms.  One main reason to have record marks is to be
able to BACKSPACE the unit.  This means that if you're positioned
at the start of record N in the file, you need to know the length of
record N-1 so that you can skip that distance backwards.

All Fortran I/O libraries I've seen (and I've even written one) have
a record mark which contains both the length of the next record
and the length of the preceeding record.  On Crays, this was represented
as a 64-bit quantity: the first 32 were the length of the preceeding
record and the second 32 were the length of the following record.

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?

--
J. Giles





  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 [this message]
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
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