diff --git a/check/features.frm b/check/features.frm index 351963a5..05665e7a 100644 --- a/check/features.frm +++ b/check/features.frm @@ -1135,3 +1135,13 @@ Print +s; assert succeeded? assert result("F") =~ expr("0"); *--#] Sortrealloc_2 : +*--#[ TempSortDir : +#: TempSortDir bad/path +Local test = 1; +.end +if mpi? + assert runtime_error?("Could not create sort file: bad/path/0formxxx.sor") +else + assert runtime_error?("Could not create sort file: bad/path/xformxxx.sor") +end +*--#] TempSortDir : diff --git a/sources/startup.c b/sources/startup.c index 4d7b930e..8aafdf03 100644 --- a/sources/startup.c +++ b/sources/startup.c @@ -801,6 +801,17 @@ classic:; while ( *t ) { *s++ = *t++; i++; } s[-2] = 'o'; *s = 0; } +/* + Try to create the sort file already, so we can Terminate earlier if this fails. +*/ + if ( ( AM.S0->file.handle = CreateFile((char *)AM.S0->file.name) ) < 0 ) { + MesPrint("Could not create sort file: %s", AM.S0->file.name); + Terminate(-1); + }; + /* Close and clean up the test file */ + CloseFile(AM.S0->file.handle); + AM.S0->file.handle = -1; + remove(AM.S0->file.name); /* With the stage4 and scratch file names we have to be a bit more careful. They are to be allocated after the threads are initialized when there