Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

file_touch

Change file access and modification times


Description

Unlike the touch POSIX utility this does not create the file if it does not exist. Use file_create() to do this if needed.

Usage

file_touch(path, access_time = Sys.time(), modification_time = access_time)

Arguments

path

A character vector of one or more paths.

access_time, modification_time

The times to set, inputs will be coerced to POSIXct objects.

Examples

file_create("foo")
file_touch("foo", "2018-01-01")
file_info("foo")[c("access_time", "modification_time", "change_time", "birth_time")]

fs

Cross-Platform File System Operations Based on 'libuv'

v1.5.0
GPL-3
Authors
Jim Hester [aut, cre], Hadley Wickham [aut], libuv project contributors [cph] (libuv library), Joyent, Inc. and other Node contributors [cph] (libuv library), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.