This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: binary/unformatted stdin
- From: Dennis Wassel <dennis dot wassel at googlemail dot com>
- To: Konstantin Kuzvesov <kuzvesov at list dot ru>
- Cc: fortran <fortran at gcc dot gnu dot org>
- Date: Tue, 6 Apr 2010 18:14:58 +0200
- Subject: Re: binary/unformatted stdin
- References: <E1NzAvx-0007lh-00.kuzvesov-list-ru@f280.mail.ru>
2010/4/6 Konstantin Kuzvesov <kuzvesov@list.ru>:
> Hello,
>
> Âhow can I get unformatted stdin in gfortran? I'm trying to do it this way:
That I need to leave to the IO experts around here ...
> Â Âopen(unit=5, form='unformatted'
>
> Âbut I get an error:
>
> Â ÂAt line 4 of file test.for (unit = 5, file = 'stdin'
> Â ÂFortran runtime error: Cannot change FORM parameter in OPEN statement
... but this is pretty clear: the stdin unit is preconnected by the
compiler, so gfortran is unhappy at runtime, because you are trying to
change access type by re-opening an already opened unit.
Just a pretty wild guess: does closing stdin and re-opening it work? I
think I've seen something about stdin manipulation on this list
before.
> ÂI need to transfer a large amount of doubles (totally sized around a gig)
> Âto fortran program via a pipe, so converting it to text forth and back is no good.
You could always just dump that into a binary file and open it to
circumvent the need for painful stdin contortions, if interoperability
is not an issue.
Cheers,
Dennis