comp.lang.ada
 help / color / mirror / Atom feed
From: Dan Nagle <dnagle@erols.com>
Subject: Re: Fortran data file -> ADA data file?
Date: Tue, 16 Jul 2002 10:56:04 -0400
Date: 2002-07-16T14:57:13+00:00	[thread overview]
Message-ID: <jbc8jucbjmda2l32qdm715fpomktio59j9@4ax.com> (raw)
In-Reply-To: 3D34148B.9F3E1F55@res.raytheon.com

Hello,

Question:

Are the Fortran files sequential access or direct access?

The Fortran standard does not specify the means of file storage,
but a common practice has evolved.

If the file is a sequential access unformatted file, then
one likely has for each record:

<4 bytes of record length>user's data<4 bytes of record length>

There may or may not be a physical endfile record.

If the file is a direct access unformatted file, then
one likely has a "pure data" file where the record is located
by using the record length specified on the Fortran open statement
and the record number (i.e., seek ((record number) - 1) * recl).
There may (or may not) be an invisible-to-the-Fortran-programmer
record 0 which contains whatever the Fortran rtl writer
thought was needed.  If so, the formula is seek
((record number) - 1) * recl + (length of record 0)

Of course, the above is all modulo endian issues.

HTH

BTW, Fortran, like Ada, is spelled with the initial only
in upper case.

-- 
Cheers!

Dan Nagle
Purple Sage Computing Solutions, Inc.

On Tue, 16 Jul 2002 08:41:47 -0400, default <default@res.raytheon.com>
wrote:

>
>Would ADA be able to process unformatted record files from FORTRAN?  I
>am trying to port some FORTRAN code to ADA and this seems like the only
>hurdle I may have.  Any input is greatly appreciated.




      parent reply	other threads:[~2002-07-16 14:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-16 12:41 Fortran data file -> ADA data file? default
2002-07-16 13:57 ` Marin David Condic
2002-07-16 14:56 ` Dan Nagle [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox