Skip to content

Does file.info man page describe ctime corrrectly?

2 messages · Graham Williams, Brian Ripley

#
(R 2.8.0 on Debian GNU/Linux sid)

?file.info contains:

mtime, ctime, atime: integer of class '"POSIXct"': file modification,
          creation and last access times.

This implies that ctime is "file [...] creation [...] time"

Has R implemented ctime differently to Unix? 

I understand, on Linux at least, that ctime is the last change time
(not the creation time). See "man ls" which says:

       -c [...] ctime (time of last modification of file status
        information) [...]

However, testing seems to indicate file.info is returning the change
time, not creation time (I'm not sure we can actually determine
creation time of a file on Linux).

Perhaps just a file.info documentation slip?

Regards,
Graham
#
This really is a topic for R-devel ... see the posting guide.
On Fri, 19 Dec 2008, Graham Williams wrote:

            
'man stat' would be more definitive, and

http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_07

even more so (but only for POSIX-compliant OSes).  As you will see, there 
is considerable room for interpretation even under POSIX.
Well, to call it 'last change' would indeed be a documentation slip. 
What it does depends on the OS and file system, but on Linux it is the 
last *status* change, which is often the creation time (modifying the file 
does not necessarily change the status).  On Windows it *is* the creation 
time, and that means it is too on a SMB-mounted Windows file system on 
Linux.