Learn R Programming

raveio (version 0.9.0)

backup_file: Back up and rename the file or directory

Description

Back up and rename the file or directory

Usage

backup_file(path, remove = FALSE, quiet = FALSE)

Value

FALSE if nothing to back up, or the back-up path if path exists

Arguments

path

path to a file or a directory

remove

whether to remove the original path; default is false

quiet

whether not to verbose the messages; default is false

Examples

Run this code

path <- tempfile()
file.create(path)

path2 <- backup_file(path, remove = TRUE)

file.exists(c(path, path2))
unlink(path2)


Run the code above in your browser using DataLab