lcOldError = on("error") llError = .f. on error llError = .t. lcFile = strtofile("file1.txt") if !llError * you successfully got the file else * there was an error endif on error &lcOldError>My problem is that another process/thread could start to use the file in the milliseconds between the time I see that the file is not in use and when I try to erase it. That's why I'd rather try to erase it until I actually do.
lnFH = FOPEN(lcFileName, 12) >>IF lnFH > 0 && file isn't in use >> FCLOSE(lnFH) >> ..... >>ELSE >>ENDIF