powered by
Like the touch POSIX utility this will create the file if it does not exist.
file_touch(path, access_time = Sys.time(), modification_time = access_time)
A character vector of one or more paths.
The times to set, inputs will be coerced to POSIXct objects.
.old_wd <- setwd(tempdir()) file_touch("foo", "2018-01-01") file_info("foo")[c("access_time", "modification_time", "change_time", "birth_time")] setwd(.old_wd)
Run the code above in your browser using DataLab