diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2006-04-25 15:05:50 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2006-04-25 15:05:50 +0000 |
commit | 884f627ed8f8d12b6a48f19a82e4d7f3a4fa178e (patch) | |
tree | 3b1f1742312e8589cbe8ab1b45f2236076d27194 /src | |
parent | 2b308b0acbac553dd069205d1bdb0aca785a8ddf (diff) |
detect whether we're in a checkpoint-recover recovery,
and if so *append* to BH_diagnostics files rather than truncating them
-- thanks to Luca for reporting this bug and pesting us for a fix,
to Erik for helpful discussions,
and to Steve for a patch which forms the basis for this commit
(tweaked to be in AHFinderDirect style)
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1443 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/BH_diagnostics.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/driver/BH_diagnostics.cc b/src/driver/BH_diagnostics.cc index 8cc4bf6..125177c 100644 --- a/src/driver/BH_diagnostics.cc +++ b/src/driver/BH_diagnostics.cc @@ -418,7 +418,11 @@ snprintf(file_name_buffer, IO_info::file_name_buffer_size, "%s/%s.ah%d.%s", directory, IO_info.BH_diagnostics_base_file_name, hn, IO_info.BH_diagnostics_file_name_extension); -FILE *fileptr = fopen(file_name_buffer, "w"); + +const char *const file_open_mode = IO_TruncateOutputFiles(state.cgi.GH) + ? "w" : "a"; + +FILE *fileptr = fopen(file_name_buffer, file_open_mode); if (fileptr == NULL) then CCTK_VWarn(FATAL_ERROR, __LINE__, __FILE__, CCTK_THORNSTRING, "\n" |