Save a copy of an existing file.
This checks if a file of given name already exists in the current directory, and if so saves a copy of it under an automatically generated name (see below).
Name of file to be saved.
This function copies the file named “first names”.ext under a name created by inserting a string of the form
.old_n between “first names” and .ext, where n is one more than the highest value for any file, matching the first names and extension, already in the current directory, and 0 if no file matches. For example, if
my.beautiful.pdf, it is copied as
my.beautiful.old_0.pdf if no
my.beautiful.old_3.pdf (and any lower n) file exists.
"" if no file with given name was present on disk, FALSE if it failed to copy an existing old file,
and the name of the copy if it successfully copied such a file.
1 2 3 4
## Not run: saveOldFile("same.story") ## End(Not run)
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.