powered by
Name conflicts in filenames are avoided by
Including the time fractions below a second (tfrac).
tfrac
Padding the name with 6 random letters.
Locking and retrying (as a last resort). The program stops after 10 unsuccessful attempts of finding a unique name.
Created by Jens Kleineheismann (2025).
createExclusiveFile(fpath = ".", prefix = "data", ext = ".dat")
A filename. Components: [prefix]_[year][month][day]_[h][min][sec]_[node]_[pid]_[pad]_[fracsec].[ext]
File path. Default: ".".
The filename. Default: "data".
The file extension. Default: ".dat".
tmp<-tempdir() fn<-createExclusiveFile(fpath=tmp, prefix="data", ext=".dat") cat(fn)
Run the code above in your browser using DataLab