getUniqueFilename {utilitiesR} | R Documentation |
Generates a unique file name by incrementing a counter.
getUniqueFilename(fPath, overwrite = FALSE)
fPath |
file path to make unique |
overwrite |
boolean, default FALSE, whether to generate a file name that is the name of an already-existing file, i.e. *don't* make the filename unique. |
unique file name, consisting of the original with a number appended (filename1.txt, filename2.txt, etc).
Other file: createFilename
,
dir.browse
, file.browse
,
getExtension
, getFilename
,
makeIfNotExists
getUniqueFilename('foo.txt') # if foo.txt exists, returns 'foo1.txt' # if foo1.txt exists, returns 'foo2.txt'. etc.