Another matter arising from my efforts to get one of my applications running under WinXP. The following program works under WinXP when logged on with admin rights, but fails when logged on as a user:
program xp_file
integer opstat
open (unit = 6, file = 'log.txt', position = 'append', action = 'write', iostat = opstat)
if (opstat .eq. 0) write (6, 10)
close (unit = 6)
stop
10 format (1x,'Gotcha!')
end program xp_file
It fails with runtime error 139 on the conditional write statement, reporting 'You may not write to a file that is READONLY' - despite the fact that iostat has returned a value of 0 indicating that the write statement is legitimate.
My copy of Metcalf & Reid, in respect of OPEN (..., action =...), says the following:
'if WRITE is specified, the READ statement must not be used (and BACKSPACE and POSITION='APPEND' may fail on some systems'
It seems a member of the group Usres on WinXP is one of those systems. I'd be interested to know the reason why this combination of specifiers is potentially problematic, but really I want to know why it doesn't fail gracefully? (i.e. with a non-zero value of iostat).
Andy