6 open(newunit
=fd
, file
='test.dat', access
='stream', form
='formatted')
7 write(fd
,'(A)') '$MeshFormat'
8 write(fd
,'(A)') 'aabbccdd'
10 call readfile
! Read test.dat
13 character(len
=20) buf1
, buf2
15 open(newunit
=fd
, file
='test.dat', access
='stream', form
='formatted')
17 if (m
/= 1) stop 'm /= 1'
19 read(fd
, *, pos
=m
) buf2
! Reread by using pos=1
20 close(fd
, status
='delete')
21 if (buf1
/= buf2
) stop 'wrong'
22 end subroutine readfile