diff options
author | tradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2002-03-28 10:04:08 +0000 |
---|---|---|
committer | tradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2002-03-28 10:04:08 +0000 |
commit | 9afdb8102e1ad940b45501cf859d28e53949f3d7 (patch) | |
tree | 2638f6c274be68869f9c254c589d89fb565148aa | |
parent | 9d54b263e7af03c0c013fd4b5ad06c0b5bcd4281 (diff) |
Create the output directory if it doesn't exist yet, before trying to copy
the parameter file into it.
This closes PR CactusBase/948.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@155 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a
-rw-r--r-- | src/Startup.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Startup.c b/src/Startup.c index 8f4ce33..e8b4609 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -247,7 +247,18 @@ static void *SetupGH (tFleshConfig *config, int convergence_level, cGH *GH) newGH->unchunked = 0; } - /* create the checkpoint directory */ + /* create the default output and checkpoint directories */ + i = IOUtil_CreateDirectory (GH, outdir, 0, 0); + if (i < 0) + { + CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, + "Problem creating default output directory '%s'", outdir); + } + else if (i > 0 && CCTK_Equals (newverbose, "full")) + { + CCTK_VInfo (CCTK_THORNSTRING, + "default output directory '%s' already exists", outdir); + } i = IOUtil_CreateDirectory (GH, checkpoint_dir, ! CCTK_Equals (out3D_mode, "onefile"), newGH->ioproc); @@ -260,8 +271,7 @@ static void *SetupGH (tFleshConfig *config, int convergence_level, cGH *GH) else if (i > 0 && CCTK_Equals (newverbose, "full")) { CCTK_VInfo (CCTK_THORNSTRING, - "IOUtil_InitGH: checkpoint directory '%s' already exists", - checkpoint_dir); + "checkpoint directory '%s' already exists", checkpoint_dir); } /* save downsampling parameters in ioUtilGH because they are temporarily |