Mail Archives: djgpp/1998/07/06/03:12:50
Greetings,
I found the following behaviour that I cannot explain: When g77
writes records to an (unformatted) output file, it adds extra an extra
byte (0x0d) if the filename extension is "out". This causes programs that
read this (unformatted) file to read garbage. The follwing program shows
this behaviour on my machine:
Compare the outputs when the file name is "example.dat" and when
the filename is "example.out" (2nd line). The latter file has an extra
0x0d.
dimension idiag(50)
open(unit=7,file='example.dat',form='unformatted')
read(*,*)num
do i=1,num
idiag(i)=i
enddo
write(7)(idiag(i),i=1,num)
close(7)
stop
end
This is not the case with g77 v0.5.19
Thanks in advance
- Raw text -