View source: R/is_files_current.R
| is_files_current | R Documentation |
I sometimes produce a couple of files by some kind of process and need to check whether they are fairly current and probably product of the same run. So I need to know whether a bunch of files was modified within the last, say, 7 days and that their modification dates do not differ by more than, say, 24 hours.
is_files_current(
...,
newer_than = 1,
units = "week",
within = 1,
within_units = "days"
)
... |
File paths. |
newer_than |
The number of units the files need to be newer than. |
units |
The unit of newer_than. See |
within |
The number of units the files need to be modified within. |
within_units |
The unit of within. See |
TRUE on success,
FALSE otherwise.
Other file utilities:
clipboard_path(),
delete_trailing_blank_lines(),
delete_trailing_whitespace(),
develop_test(),
file_copy(),
file_modified_last(),
file_save(),
find_files(),
get_lines_between_tags(),
get_mtime(),
get_unique_string(),
grep_file(),
is_path(),
paths,
search_files(),
split_code_file(),
touch()
p1 <- tempfile()
p2 <- tempfile()
p3 <- tempfile()
touch(p1)
touch(p2)
Sys.sleep(3)
touch(p3)
is_files_current(p3, newer_than = 1, units = "days",
within = 4, within_units = "secs")
is_files_current(p1, p2, p3, newer_than = 1, units = "days",
within = 4, within_units = "secs")
is_files_current(p1, p2, p3, newer_than = 1, units = "days",
within = 1, within_units = "secs")
is_files_current(p1, p2, p3, newer_than = 1, units = "secs",
within = 4, within_units = "secs")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.