From 391e4743798a3bd02dc0ad673fa2da9dcdaf3510 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Wed, 22 Mar 2006 17:52:07 -0500 Subject: [svn-r12138] Purpose: VMS port Description: Unix remove function removes only the latest version of a file on VMS. Some of our tests create multiple versions of the testfiles and as a result, test programs may be confused, give false negative result, etc. Solution: Created HDremove_all function for VMS that removes all versions of the files. HDremove on VMS is an alias to HDremove_all. Platforms tested: VMS server and heping (to check that nothing is borken on UNIX side) Misc. update: --- src/H5.c | 36 ++++++++++++++++++++++++++++++++++++ src/H5private.h | 3 ++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/H5.c b/src/H5.c index 9988414..d2024ab 100644 --- a/src/H5.c +++ b/src/H5.c @@ -3150,3 +3150,39 @@ void HDsrand(unsigned int seed) } #endif +/*------------------------------------------------------------------------- + * Function: HDremove_all + * + * Purpose: Wrapper function for remove on VMS systems + * + * This function deletes all versions of a file + * + * Return: Success: 0; + * + * Failure: -1 + * + * Programmer: Elena Pourmal + * March 22, 2006 + * + * Modifications: + *------------------------------------------------------------------------- + */ +#ifdef H5_VMS + + +int HDremove_all(char *fname) +{ + int ret_value = -1; + char *_fname; + _fname = malloc(strlen(fname)+3); /* to accomodate ;* and null */ + if(_fname) { + strcpy(_fname, fname); + strcat(_fname,";*"); + remove(_fname); + free(_fname); + ret_value = 0; + } + return ret_value; +} +#endif + diff --git a/src/H5private.h b/src/H5private.h index 8a10783..cf16bce 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -789,7 +789,8 @@ H5_DLL int HDrand(void); #define HDreaddir(D) readdir(D) #define HDrealloc(M,Z) realloc(M,Z) #ifdef H5_VMS -#define HDremove(Y) remove(Y";*") +#define HDremove(S) HDremove_all(S) +int HDremove_all(char * fname); #else #define HDremove(S) remove(S) #endif /*H5_VMS*/ -- cgit v0.12