Learn R Programming

fritools (version 3.3.0)

touch: Mock the Unix touch Utility

Description

Creating a file or ensuring a file's modification time changes.

Usage

touch(path)

Arguments

path

Path to the file to be touched.

Value

The Path to the file touched.

See Also

Other file utilities: file_copy(), file_modified_last(), file_save(), find_files(), get_mtime(), get_unique_string(), is_files_current(), is_path(), paths, search_files(), split_code_file()

Examples

Run this code
# NOT RUN {
file <- tempfile()
touch(file)
t1 <- file.mtime(file)
touch(file)
t2 <- file.mtime(file)
t1 < t2
file <- file.path(tempfile(), "path", "not", "there.txt")
touch(file)
file.exists(file)
# }

Run the code above in your browser using DataLab