Reading unknown number of values in unformatted file
- From: Patrick Begou <Patrick.Begou@xxxxxxxxxxx>
- Date: Tue, 06 Feb 2007 17:53:27 +0100
I am stuck on an I/O probleme with unformatted read in fortran.
- I've opened an unformatted file,
OPEN(10,FILE='toto.dat',FORM='UNFORMATTED')
REWIND(10)
- I've read several datas.
- At this step I can have to read 2 or 3 real values !
It could be:
READ(10,err=101,end=102) u1, u2, u3
or
READ(10,err=101,end=102) u1, u2
with u1, u2, u3 declared as REAL.
- read other datas...
I cannot found a solution to read safely u1,u2,u3 OR u1,u2 depending on what is in the file. I was looking for a solution like reading in a buffer (and then analyse the buffer)... but all that I try fails... Most of my ideas only works for Formatted files :-(
Thanks for any suggestions
Patrick
.
- Follow-Ups:
- Re: Reading unknown number of values in unformatted file
- From: lello
- Re: Reading unknown number of values in unformatted file [SOLUTION]
- From: Patrick Begou
- Re: Reading unknown number of values in unformatted file
- From: glen herrmannsfeldt
- Re: Reading unknown number of values in unformatted file
- From: Paul van Delst
- Re: Reading unknown number of values in unformatted file
- Prev by Date: Re: Integer Coersion
- Next by Date: Re: Integer Coersion
- Previous by thread: Integer Coersion
- Next by thread: Re: Reading unknown number of values in unformatted file
- Index(es):
Relevant Pages
|