- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A trip around Fortran I/O functions.
A Fortran application, launched by a C++ driver, writes a stream file which is later processed by the C++ application.
Now to add a backup feature, the fortran application at a certain point should:
1) find the actual position of the file (INQUIRE POS=ipos1)
2) write additional data, close and copy the file.
3) reopen the file and reposition at ipos1, for continuing the execution.
I am unable to find a fortran statement/specifier to restart writing data at ipos1.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use
write(unit, pos = ipos) stuff
with stream I/O. See Metcalf, Reid & Cohen Modern Fortran Explained 10.16.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
open output file
open copy file//sequence number
loop:
...
write to output file
write to copy file
if(time to close copy file) then
write additional stuff to copy file
close copy file
bump sequence number
open copy file//sequence number
end if
end loop
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page