| Sys.setFileTime {base} | R Documentation |
Set File Time
Description
Uses system calls to set the times on a file or directory.
Usage
Sys.setFileTime(path, time)Arguments
path | A character vector containing file or directory paths. |
time | A date-time of class |
Details
This attempts sets the file time to the value specified.
On a Unix-alike it uses the system callutimensat if that isavailable, otherwiseutimes orutime. On a POSIX filesystem it sets both the last-access and modification times.Fractional seconds will set as fromR 3.4.0 on OSes with therequisite system calls and suitable filesystems.
On Windows it uses the system callSetFileTime to set the‘last write time’. Some Windows file systems only record thetime at a resolution of two seconds.
Sys.setFileTime has been vectorized inR 3.6.0. Earlier versionsofR requiredpath andtime to be vectors of length one.
Value
A logical vector indicating if the operation succeeded for each of thefiles and directories attempted, returned invisibly.