DECLARE Long DeleteFile IN WIN32API STRING lcFileName = gcClientFat+'StyleSheet\'+PADL(gnMember,6,'0')+lcNextItem+'.css' lnResult = DeleteFile(lcFileName) && return 0 - file deleted>I have a situation that I would like to resolve. It happens once after a million processes but I would like to make sure it doesn't happen again. I am using FOPEN() to detect if a specific file exist. If it exists, I FCLOSE() and ERASE it. However, if two users are going into that process at the about same time, it may well be that once one does FCLOSE() that the other one gets its FOPEN() before the first one do the ERASE thus it generates an error on the first one on that command.
>lnHandle=FOPEN(gcClientFat+'StyleSheet\'+PADL(gnMember,6,'0')+lcNextItem+'.css',12) >IF lnHandle>0 > FCLOSE(lnHandle) > ERASE (gcClientFat+'StyleSheet\'+PADL(gnMember,6,'0')+lcNextItem+'.css') >ENDIF >>