IOR add warning if file exists #273. To stop on warnings, use existing flag --warningAsErrors

master
Julian M. Kunkel 2020-12-01 18:24:09 +00:00
parent 691324f17b
commit da03ae5c9f
1 changed files with 9 additions and 0 deletions

View File

@ -1293,6 +1293,15 @@ static void TestIoSys(IOR_test_t *test)
/* loop over test iterations */
uint64_t params_saved_wearout = params->stoneWallingWearOutIterations;
/* Check if the file exists and warn users */
struct stat sb;
GetTestFileName(testFileName, params);
int ret = backend->stat(testFileName, & sb, params->backend_options);
if(ret == 0) {
EWARNF("The file \"%s\" exists already and will be overwritten", testFileName);
}
for (rep = 0; rep < params->repetitions; rep++) {
/* Get iteration start time in seconds in task 0 and broadcast to
all tasks */