Skip to contents

Determine a file or directory's modification time. Other than base::file.mtime(), this function is based on fs::file_info() and the datetime of modification is returned in UTC by default.

Usage

path_mod_time(path, follow = FALSE, tz = "UTC")

Arguments

path

A character vector of one or more paths.

follow

If TRUE, symbolic links will be followed (recursively) and the results will be that of the final file rather than the link.

tz

Timezone to return the result in. A character scalar where "" means the current time zone.

Value

A datetime.

See also

Other path functions: draw_path_tree(), flatten_path_tree()

Examples

fs::path_package(package = "dplyr",
                 "DESCRIPTION") |>
  pal::path_mod_time()
#> [1] "2023-11-22 23:27:48 UTC"