r - Update modification time of a file (touch) -
how touch
file (i.e., update modification time without changing contents) in r? i'm looking cross-platform built-in (or packaged) equivalent of:
system2("touch", file_name)
see ?sys.setfiletime
in case sys.setfiletime(path_to_file_or_directory, sys.time())
presumably job done:
on unix-alike uses system call ‘utimes’ if available, otherwise ‘utimes’. on posix file system sets both last-access , modification times.
on windows uses system call ‘setfiletime’ set ‘last write time’. windows file systems record time @ resolution of 2 seconds.
although i'm not sure how reconcile "it uses system call ‘utimes’ if available, otherwise ‘utimes’" meaningful statement.
Comments
Post a Comment