diff options
author | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-04-05 21:05:55 +0000 |
---|---|---|
committer | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-04-05 21:05:55 +0000 |
commit | 89fb0b58d9d103db11b7e18286dccd9825fd7754 (patch) | |
tree | 9f7f1ecbc3036dce22206898b7df15a9ea77e9c5 /src | |
parent | 55e80b4dc1af49f96e59f085f9c00d134d708a52 (diff) |
Omit the dotslash in advertised output filenames if output goes into
current directory.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@87 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src')
-rw-r--r-- | src/Write.c | 10 | ||||
-rw-r--r-- | src/WriteGF.c | 24 |
2 files changed, 29 insertions, 5 deletions
diff --git a/src/Write.c b/src/Write.c index 6eb155a..5ae5bb4 100644 --- a/src/Write.c +++ b/src/Write.c @@ -65,8 +65,16 @@ void IOBasic_Write (cGH *GH, int vindex, const char *alias) myGH = (iobasicGH *) GH->extensions [CCTK_GHExtensionHandle ("IOBasic")]; /* build the output filename */ + /* skip the pathname if output goes into current directory */ fname = (char *) malloc (strlen (myGH->outdirScalar) + strlen (alias) + 5); - sprintf (fname, "%s/%s.tl", myGH->outdirScalar, alias); + if (strcmp (myGH->outdirScalar, ".")) + { + sprintf (fname, "%s/%s.tl", myGH->outdirScalar, alias); + } + else + { + sprintf (fname, "%s.tl", alias); + } /* see if output files for this alias name were already created */ if (GetNamedData (myGH->filenameListScalar, fname) == NULL) diff --git a/src/WriteGF.c b/src/WriteGF.c index d5c7d18..71f7b05 100644 --- a/src/WriteGF.c +++ b/src/WriteGF.c @@ -168,8 +168,16 @@ void IOBasic_WriteGF (cGH *GH, /* build the filename */ if (new_filename_scheme) { - sprintf (filename, "%s/%s_%s%s", myGH->outdirScalar, alias, - reduction_op, file_extension); + /* skip the pathname if output goes into current directory */ + if (strcmp (myGH->outdirScalar, ".")) + { + sprintf (filename, "%s/%s_%s%s", myGH->outdirScalar, alias, + reduction_op, file_extension); + } + else + { + sprintf (filename, "%s_%s%s", alias, reduction_op, file_extension); + } } else { @@ -194,8 +202,16 @@ void IOBasic_WriteGF (cGH *GH, { file_extension = "unknown"; } - sprintf (filename, "%s/%s_%s.tl", myGH->outdirScalar, alias, - file_extension); + /* skip the pathname if output goes into current directory */ + if (strcmp (myGH->outdirScalar, ".")) + { + sprintf (filename, "%s/%s_%s.tl", myGH->outdirScalar, alias, + file_extension); + } + else + { + sprintf (filename, "%s_%s.tl", alias, file_extension); + } } /* see if output files for this alias name were already created */ |