aboutsummaryrefslogtreecommitdiff
path: root/src/WriteScalar.c
diff options
context:
space:
mode:
authortradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2004-11-17 18:44:04 +0000
committertradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2004-11-17 18:44:04 +0000
commite888edd46d420786c41a918f2111cbdab296a93d (patch)
treeab94c7b7b3af327a020d7cb1a06e405a292ed5f3 /src/WriteScalar.c
parentc4fa6097dbef8188b858a63ad264a10aa7c94d98 (diff)
Use aliased function IO_TruncateOutputFiles() to check whether or not
to truncate existing output files. You must also update CactusBase/IOUtil now. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@160 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/WriteScalar.c')
-rw-r--r--src/WriteScalar.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/WriteScalar.c b/src/WriteScalar.c
index 02e64b8..f0ad792 100644
--- a/src/WriteScalar.c
+++ b/src/WriteScalar.c
@@ -16,7 +16,6 @@
#include "cctk.h"
#include "cctk_Parameters.h"
-#include "CactusBase/IOUtil/src/ioGH.h"
#include "CactusBase/IOUtil/src/ioutil_AdvertisedFiles.h"
#include "iobasicGH.h"
@@ -367,16 +366,14 @@ static FILE *OpenScalarFile (const cGH *GH,
int first_time_through;
FILE *file;
iobasicGH *myGH;
- const ioGH *ioUtilGH;
char *fullname;
char comment_char, buffer[128];
ioAdvertisedFileDesc advertised_file;
DECLARE_CCTK_PARAMETERS
- /* get the GH extension handles for IOUtil and IOBasic */
+ /* get the GH extension handle for IOBasic */
myGH = CCTK_GHExtension (GH, "IOBasic");
- ioUtilGH = CCTK_GHExtension (GH, "IO");
/* get the variable's full name */
fullname = CCTK_FullName (vindex);
@@ -385,7 +382,7 @@ static FILE *OpenScalarFile (const cGH *GH,
If restart from recovery, existing files are opened in append mode. */
first_time_through = GetNamedData (myGH->filenameListScalar, filename)==NULL;
file = fopen (filename,
- ioUtilGH->recovered || ! first_time_through ? "a" : "w");
+ IO_TruncateOutputFiles (GH) && first_time_through ? "w" : "a");
if (! file)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,