Check out file.info()
for ctime
and other file properties:
## With a single path
p <- R.home()
file.info(p)$ctime
# [1] "2014-11-20 08:15:53 PST"
## With a vector of multiple paths
paths <- dir(R.home(), full.names=TRUE)
tail(file.info(paths)$ctime)
# [1] "2014-11-20 09:00:45 PST" "2014-11-20 09:00:47 PST"
# [3] "2014-11-20 09:00:47 PST" "2014-11-20 09:00:50 PST"
# [5] "2014-11-20 09:00:33 PST" "2014-11-20 09:00:33 PST"
Notice the definition of ctime
isn't necessarily the file's creation time:
What is meant by the three file times depends on the OS and file system. On Windows native file systems ctime
is the file creation time (something which is not recorded on most Unix-alike file systems).