Learn R Programming

xega (version 0.9.0.18)

createExclusiveFile: Create a unique filename.

Description

Name conflicts in filenames are avoided by

  • Including the time fractions below a second (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).

Usage

createExclusiveFile(fpath = ".", prefix = "data", ext = ".dat")

Value

A filename. Components: [prefix]_[year][month][day]_[h][min][sec]_[node]_[pid]_[pad]_[fracsec].[ext]

Arguments

fpath

File path. Default: ".".

prefix

The filename. Default: "data".

ext

The file extension. Default: ".dat".

Examples

Run this code
tmp<-tempdir()
fn<-createExclusiveFile(fpath=tmp, prefix="data", ext=".dat") 
cat(fn)

Run the code above in your browser using DataLab