Skip to content
  • Mark OLESEN's avatar
    ENH: add support for OFstream atomic file creation (#2631) · 5338e56c
    Mark OLESEN authored
    - with ATOMIC, an intermediary file is created - eg, (fileAbc~tmp~)
      where all of the output is written to. When the stream goes out of
      scope, this intermediary file is moved/renamed to the actually
      output name - eg, (fileAbc~tmp~) -> (fileAbc).
    
      This adds some safety if the simulation crashes while writing the
      file, since it will the partial (corrupt) file will be left
      behind as (fileAbc~tmp~) and not as (fileAbc), which means it will
      will be treated as a backup file and not loaded again on restart.
    
    ENH: provided enumeration for APPEND/NON_APPEND
    
    - clearer than using bool (with comments).
      Since append mode is primarily only used by masterOFstream etc
      this change is unlikely to affect user coding.
    
    ENH: use file atomic for ensight file creation
    
    - avoids corrupt (truncated) files being referenced by the ensight
      case file if the simulation crashes while writing the ensight file.
    5338e56c