R find time when a file was created

file, metadata, r

Solution

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).

Problem

I am using R function list.files to get a list of files in a folder. I would also like to record when each file was created, modified and accessed how can i do that? i tried google search, but didnt find any useful command Below screenshot is from my Windows machine. I get it when i right click a file name and click "properties"

Original source

Related problems