2 ! Test the error message when an unformatted file has become
6 integer(kind=4) :: i1, i2
8 character(len=50) :: msg
10 ! Write out a truncated unformatted sequential file by
11 ! using unformatted stream.
13 open (10, form="unformatted", access="stream", file="foo.dat", &
16 close (10, status="keep")
19 open (10, file="foo.dat", form="unformatted", access="sequential")
22 read (10, iostat=ios, iomsg=msg) i1, i2
23 if (ios == 0) call abort
24 if (i1 /= 1) call abort
25 if (msg /= "Unformatted file structure has been corrupted") call abort
26 close (10, status="delete")