IO: Add ACTION and STATUS flags to OPEN statements.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2023-12-20 18:33:58 -03:00
parent 9455f9be9a
commit 68449d0ccc

View File

@ -2420,7 +2420,8 @@ module io
'compressed_size', csize) 'compressed_size', csize)
allocate(buffer(csize)) allocate(buffer(csize))
open (newunit=io, file=file_path, access='stream', action='read') open (newunit=io, file=file_path, access='stream', &
status='old', action='read')
read (io) buffer read (io) buffer
close (io) close (io)
@ -2474,7 +2475,8 @@ module io
end if end if
else else
open (newunit=io, file=file_path, access='stream', action='read') open (newunit=io, file=file_path, access='stream', &
status='old', action='read')
read (io) array read (io) array
close (io) close (io)
end if end if
@ -2611,7 +2613,8 @@ module io
filename = trim(array_file) // '.bin' // file_suffix filename = trim(array_file) // '.bin' // file_suffix
filepath = trim(data_path) // trim(filename) filepath = trim(data_path) // trim(filename)
open (newunit=io, file=filepath, access='stream') open (newunit=io, file=filepath, access='stream', &
action='write', status='replace')
write (io) buffer(1:cbytes) write (io) buffer(1:cbytes)
close (io) close (io)
@ -2646,7 +2649,8 @@ module io
filename = trim(array_file) // '.bin' filename = trim(array_file) // '.bin'
filepath = trim(data_path) // trim(filename) filepath = trim(data_path) // trim(filename)
open (newunit=io, file=filepath, access='stream') open (newunit=io, file=filepath, access='stream', &
action='write', status='replace')
write (io) array write (io) array
close (io) close (io)