Upcoming patch and question
Thomas Koenig
Thomas.Koenig@online.de
Wed Nov 9 18:12:00 GMT 2005
On Wed, Nov 09, 2005 at 12:59:06AM -0800, Jerry DeLisle wrote:
> I have tested 24700, but it does not dawn on me how to do a test case for
> that one since I have to do a hex dump of the file to check it.
One way to read byte-by-byte is to use kind=1 integer variables,
then do unformatted direct access. Like this (untested, I'm not
sure I remembered all the keywords right :-)
program main
integer(kind=1) b(4)
! ... do whatever to write the file
open("foo.dat",status="old",form="unformatted",access="direct",recl=4)
read(10,rec=1) b
if (any (b /= (/ 10, 20, 30, 40 /))) call abort
... and so on.
More information about the Fortran
mailing list