🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #2271

Re: Q: Fortran unformatted i/o with GNU f2c/gcc problem.

#2271
From: Steven G. Johnson
Date: Mon, 05 Oct 1998 00:00
21 lines
1693 bytes
Toon Moene <toon@moene.indiv.nluug.nl> wrote:
>Raymond Toy <toy@rtp.ericsson.se> wrote:
>> There is one more option, but that would probably require a fair
>> number of changes to you code.  Use unformatted, random access files.
>
>Indeed, and it even works for g77 (tried it down to a - four byte - integer).
>
>However, this is woefully expensive in (CPU|I/O) time.

In any case, this scheme is still not portable.  What happens if you write
a file on a big-endian machine and try to read it on a little-endian
machine?  Or on machines where integers are different sizes (64-bit and
32-bit)?  Or where a different representation of floating-point numbers is
used?

There are libraries to take care of these issues for you (e.g. HDF), but
unless you really need the performance and size advantages of binary data,
you're better off sticking with ASCII.

Cordially,
Steven G. Johnson
Technical Details
Message-ID: <stevenj-ya02408000R0510980130360001@news.mit.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <F02psK.Apn@midway.uchicago.edu> <lpaF02tvI.5Aw@netcom.com> <F041A8.Ix@midway.uchicago.edu> <4nn27evqdk.fsf@rtp.ericsson.se> <6v35k2$9br$1@newnews.nl.uu.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,e0781954572e0423
X-Google-Attributes: gid11318c,public
X-Google-Thread: 1025b4,e0781954572e0423
X-Google-Attributes: gid1025b4,public
From: stevenj@alum.mit.edu (Steven G. Johnson)
Subject: Re: Q: Fortran unformatted i/o with GNU f2c/gcc problem.
Date: 1998/10/05
Message-ID: <stevenj-ya02408000R0510980130360001@news.mit.edu>
X-Deja-AN: 397819296
Content-Transfer-Encoding: 8bit
References: <F02psK.Apn@midway.uchicago.edu> <lpaF02tvI.5Aw@netcom.com> <F041A8.Ix@midway.uchicago.edu> <4nn27evqdk.fsf@rtp.ericsson.se> <6v35k2$9br$1@newnews.nl.uu.net>
Content-Type: text/plain; charset=ISO-8859-1
Organization: Massachusetts Institute of Technology
Mime-Version: 1.0
Newsgroups: gnu.misc.discuss,gnu.gcc.help