This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Reading 32bit unformatted files in 64bit systems
- From: Arjen Markus <arjen dot markus895 at gmail dot com>
- To: Ignacio Fernández Galván <jellby at yahoo dot com>
- Cc: fortran at gcc dot gnu dot org
- Date: Fri, 30 Dec 2011 13:35:25 +0100
- Subject: Re: Reading 32bit unformatted files in 64bit systems
- References: <1325248304.33957.YahooMailClassic@web161002.mail.bf1.yahoo.com>
Hi Ignacio,
2011/12/30 Ignacio Fernández Galván <jellby@yahoo.com>:
> Oh, I'm sorry... I removed the length block (00 00 00 54). The file is SEQUENTIAL UNFORMATTED. I think I have found out the problem is the endianness of the data. It's strange because I have never had an endianness problem with all the computers I've used, and no reference I have found about the DCD format mentions the endianness (which seems to be big-endian in this sample file).
endianness is a property of the machine on which you run the program.
It is (most of the time) beyond the
control of the program itself. The Intel Fortran compiler offers an
extension to read/write files with a different
endianness than that of the machine. In this case it would be very
useful to have that in gfortran too (but it
remains an extension).
Regards,
Arjen