Bug 17261 - file.info returns <NA> filetime for directories
Summary: file.info returns <NA> filetime for directories
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: Windows GUI / Window specific (show other bugs)
Version: R-devel (trunk)
Hardware: All Windows 64-bit
: P5 normal
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2017-04-25 17:41 UTC by duncan
Modified: 2017-04-25 21:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description duncan 2017-04-25 17:41:43 UTC
[This is release 3.4.0, there's no Bugzilla option atm]

Starting in R 3.4.0, file.info *sometimes* returns <NA> for mtime, atime and ctime for directories.  It seems to have something to do with sharing.  This affects functions that use file.mtime like update.packages.

Reproduce: 

Try file.info() with a random directory.  If it returns a legitimate file time, open a windows explorer window and navigate to the directory, then run the call again and it will return <NA>s.

In some cases it returns <NA>s even if the directory is not open (or in the path of an open explorer window), but this is not consistent. 

Platform: 

Windows 10 x64, both x86 and x64 R 3.4.0; also happens on Windows 7 32-bit (not tested on Win7/64).

Example 
```
R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"

> file.info( "c:\\windows" )
            size isdir mode mtime ctime atime exe
c:\\windows    0  TRUE  777  <NA>  <NA>  <NA>  no
```

Previous behavior
```
R version 3.3.3 (2017-03-06) -- "Another Canoe"

> file.info("c:\\windows")
            size isdir mode               mtime               ctime
c:\\windows    0  TRUE  777 2017-04-15 10:46:50 2017-03-18 04:40:20
                          atime exe
c:\\windows 2017-04-15 10:46:50  no
```
Comment 1 Tomas Kalibera 2017-04-25 21:21:49 UTC
Thank you for the report, this is a known bug that has been fixed recently in R-devel (r72606).