> If the named file does not exist or is empty, running
> the program creates an empty file, then ends with message:
>
> File access and properties are incompatible
The example program you give requires a rec=?? specifier in order to
work correctly. The following should work:
program x
character (len=30) :: scr2 = "X123.XXX"
kerror=0
k1 = 16
open(13,file=scr2(1:len_trim(scr2)),access='direct', &
& recl=k1,iostat=kerror)
if(kerror /= 0) then
print *, "File not opened", kerror
stop
endif
write(13,rec=1) scr2(1:k1)
end program x
Regards,
Mark
--
Mark Stevens Salford Software Ltd
Adelphi House, Adelphi Street, Salford, M3 6EN, UK
Tel: +44 161 834 2454 Fax: +44 161 834 2148
http://www.salford.co.uk/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|