[R] How to get "last status change", ctime on Windows?

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Oct 10 07:20:22 CEST 2009


On Fri, 9 Oct 2009, Duncan Murdoch wrote:

> On 09/10/2009 5:05 PM, johannes rara wrote:
>> Hi,
>> 
>> file.info is producing data.frame with ctime variable. Help file says
>> that on Unix this is 'last status change' and on Windows 'creation
>> time'.

No, that is not what it says.  It actually says

      What is meant by the three file times depends on the OS and file
      system.  On Windows 'ctime' is the creation time.

The POSIX standard 1003 uses these terms, and its definitions are at
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_07
but of course Windows does not claim to be POSIX-compliant.

So the help page is answering Duncan's question

> What does "last status change" mean on Windows?

by saying that on Windows 'last status change' means 'creation time'.

Unix-alikes differ in what they say about ctime, but for example Linux says

    The field st_ctime is changed by writing or by setting inode
    information (i.e., owner, group, link count, mode, etc.).

Windows does not have inodes nor most of those concepts ... so we need 
to look at what its system documentation (MSDN) says it returns in the 
field st_ctime of its 'stat' system call.  Other sources suggest that 
MSDN is wrong and st_ctime returns 'creation time' only on Windows' 
native file systems: but that possibility is covered by the two 
sentences quoted.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list