Read/Write of unformatted files usin g77

Toon Moene toon@moene.indiv.nluug.nl
Fri Sep 27 15:54:00 GMT 2002


Memo García wrote:

> I´m not sure if this is a bug or a feature :-)

Necessary evil ;-)

> The problem that I have porting Absoft F77 code to g77 is with the way 
> that unformatted files are read/written.
> 
> Using the Absoft compiler, the unformatted files does not require the 
> the record size, I presume, that g77 put as trailing and leading 
> information in every record.

Indeed; the record length in bytes.

> I have a lot of programas that read binary information generated by 
> other non Fortran applications that don´t include the size of the record.
> 
> Is thera a way to tell the compiler to not use this feature?

Nope.

The reason this is done this way is to be able to support several 
Standard Fortran I/O requirements on an OS that doesn't have a native 
record structured file format:

1. Skipping an unformatted record via an "empty" read:

       READ(7)

2. Backspacing an unformatted record:

       BACKSPACE(7)

Sorry to be of so little help.

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)



More information about the Gcc-bugs mailing list