Now, at a later stage I want to reopen the file and append additional data to it. I figured the way to do this is to use the position=‘append’ specifier as follows:
Can you please either post or send to PGI Customer Service (trs@pgroup.com) a reproducing example? Also, please include what version of the compiler and OS you’re using.
Note that the first open shouldn’t matter given the error has to with some conflict with the specifiers given in the second open. However I’m not sure what the conflict is. The open statement looks fine to me and when I try it in a simple example, it works as expected.
Thanks for your reply. Here’s the output from pgf95 -V:
pgf95 11.10-0 64-bit target on x86-64 Linux -tp istanbul
The code below generates the following run-time error on my system:
PGFIO-F-202/OPEN/unit=500/conflicting specifiers.
File name = test.bin
In source file binappendtest.f90, at line number 8
Best,
Maarten
program test
integer, parameter :: PR = 8
real(PR) :: tmp(5)
open(500,file='test.bin',status='new',action='write',access='stream',form='unformatted')
write(500) 1._PR,2._PR,3._PR
call flush(500)
close(500)
open(500,file='test.bin',status='old',action='write',access='stream',form='unformatted',position='append')
write(500) 4._PR, 5._PR
call flush(500)
close(500)
open(500,file='test.bin',status='old',action='read',access='stream',form='unformatted')
read(500) tmp
print *, tmp
end program test
I found the TPR, #18677. Looks like prior to 12.6 we disallowed using position with stream access. There was a secondary issue where position couldn’t zero that was fixed in 12.10.