From 9afdb8102e1ad940b45501cf859d28e53949f3d7 Mon Sep 17 00:00:00 2001 From: tradke Date: Thu, 28 Mar 2002 10:04:08 +0000 Subject: 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 --- src/Startup.c | 16 +++++++++++++--- 1 file 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 -- cgit v1.2.3