Discussion Overview
The discussion revolves around finding an alternative to the flush() command in Fortran 90, which is not recognized by the f90 compiler. Participants explore potential methods to achieve similar functionality, particularly in the context of file handling and buffering.
Discussion Character
- Technical explanation
- Debate/contested
Main Points Raised
- One participant notes that closing and immediately re-opening the file could achieve a similar result to flush(), though this may not be straightforward due to the file being opened with position='append'.
- Another participant emphasizes that while closing and re-opening will flush buffers, it is crucial to maintain the current file position, which could complicate the process.
- There is a suggestion that flush is primarily a C command, but there may be a Fortran equivalent that does not require closing and reopening the file.
- A participant raises the question of whether the current file position can be determined from the code, suggesting that if it is at a convenient location, repositioning after closing could be feasible.
- One participant asserts that if the file is opened with the append attribute, closing and reopening it should maintain the file pointer's position, provided it is a sequential text file without concurrent processes.
- It is mentioned that some f90 dialects might support a flush command without needing to specify the unit number.
Areas of Agreement / Disagreement
Participants express uncertainty about the best approach to replicate the flush() functionality in Fortran 90. There are multiple competing views on how to handle file positioning and buffering, and no consensus is reached on a definitive solution.
Contextual Notes
The discussion highlights the limitations of the f90 compiler regarding the flush() command and the implications of file attributes like position='append' on file handling strategies.