aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOASCII
diff options
context:
space:
mode:
authortradke <schnetter@cct.lsu.edu>2004-11-17 18:35:00 +0000
committertradke <schnetter@cct.lsu.edu>2004-11-17 18:35:00 +0000
commit545d5b76a2ade3dd3e595492122da8cc454d0e23 (patch)
tree5d8bd067f2dcea340e1bd6edc41516e527d10c83 /Carpet/CarpetIOASCII
parentd05a99da36ea8068cb17566caac4a307764fcad2 (diff)
Use aliased function IO_TruncateOutputFiles() to check whether or not to truncate existing output files
darcs-hash:20041117183557-3fd61-35b878baefc7f13303163f54eb4489cbfc9f8690.gz
Diffstat (limited to 'Carpet/CarpetIOASCII')
-rw-r--r--Carpet/CarpetIOASCII/interface.ccl7
-rw-r--r--Carpet/CarpetIOASCII/src/ioascii.cc2
2 files changed, 8 insertions, 1 deletions
diff --git a/Carpet/CarpetIOASCII/interface.ccl b/Carpet/CarpetIOASCII/interface.ccl
index 204b134f6..6a8d20b63 100644
--- a/Carpet/CarpetIOASCII/interface.ccl
+++ b/Carpet/CarpetIOASCII/interface.ccl
@@ -20,3 +20,10 @@ uses include header: ggf.hh
CCTK_INT last_output_iteration[4] TYPE=scalar
CCTK_REAL last_output_time[4] TYPE=scalar
CCTK_INT this_iteration[4] TYPE=scalar
+
+
+# function to check whether existing output files should be truncated or not
+CCTK_INT FUNCTION IO_TruncateOutputFiles \
+ (CCTK_POINTER_TO_CONST IN GH)
+
+REQUIRES FUNCTION IO_TruncateOutputFiles
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc
index 1bb022558..31f44784a 100644
--- a/Carpet/CarpetIOASCII/src/ioascii.cc
+++ b/Carpet/CarpetIOASCII/src/ioascii.cc
@@ -466,7 +466,7 @@ namespace CarpetIOASCII {
// If this is the first time, then write a nice header
if (do_truncate.at(n)) {
struct stat fileinfo;
- if (! iogh->recovered
+ if (IO_TruncateOutputFiles (cgh)
|| stat(filename, &fileinfo)!=0) {
file.open (filename, ios::out | ios::trunc);
if (! file.good()) {