Sys.setFileTime: Set File Time

Description Usage Arguments Details Value


Uses system calls to set the times on a file or directory.





A length-one character vector specifying the path to a file or directory.


A date-time of class "POSIXct" or an object which can be coerced to one. Fractions of a second are ignored (prior to R 3.4.0).


This attempts sets the file time to the value specified.

On a Unix-alike it uses the system call utimes if that is available, otherwise utime. On a POSIX file system it sets both the last-access and modification times.

On Windows it uses the system call SetFileTime to set the ‘last write time’. Some Windows file systems only record the time at a resolution of two seconds.


Logical, invisibly. An indication if the operation succeeded.

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.