diff options
author | tradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d> | 2002-02-21 17:30:38 +0000 |
---|---|---|
committer | tradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d> | 2002-02-21 17:30:38 +0000 |
commit | ab5d5e620f29ef09611958b62112db693edbbc1b (patch) | |
tree | 469b7c23c88ef679ced416a3e57018c47274fdc2 | |
parent | 16f44531df7f9e7ab7c7f7e0d9efb576f28c9bd5 (diff) |
Don't attempt to write to a file if it couldn't be opened.
Instead, print a warning and try to continue.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5/trunk@101 4825ed28-b72c-4eae-9704-e50c059e567d
-rw-r--r-- | src/Write.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Write.c b/src/Write.c index 60987ba..bedb51e 100644 --- a/src/Write.c +++ b/src/Write.c @@ -145,6 +145,12 @@ int IOHDF5_Write (const cGH *GH, int vindex, const char *alias) { IOHDF5_ERROR (file = H5Fopen (filename, H5F_ACC_RDWR, plist)); } + if (file < 0) + { + CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, + "Couldn't %s IOHDF5 output file '%s'", + is_new_file ? "create" : "open", filename); + } IOHDF5_ERROR (H5Pclose (plist)); } |