[Rd] file.info() on file larger than 2GB

Roger D. Peng rpeng at jhsph.edu
Wed Sep 1 04:05:12 CEST 2004


Indeed, when I tried the same on a 64-bit OS I got the usual 
(correct) information from file.info().  The size is wrong in R 
1.9.1 but that seems to have been fixed in R-devel.

-roger

Prof Brian Ripley wrote:

> This is a purely OS issue: your OS has not been set up so the fopen and
> stat calls handle > 2Gb files.  There is one R issue: the size will
> overflow in file.info.
> 
> For example, under Solaris 64-bit applications can handle such files 
> whereas 32-bit ones need calls to stat64, fopen64 etc.
> 
> It seems a very exotic need, but if someone wants to find out how to use 
> the OS-specific ways to extend stat etc and supply patches, please do so.
> 
> We don't put OS-specific limitations on help pages.
> 
> On Tue, 31 Aug 2004, Roger D. Peng wrote:
> 
> 
>>I've got a file that's approximately 2.2GB and it seems to be foiling 
>>file.info().  When I run `stat' from the shell I get
>>
>>zooey:> stat data.csv
>>   File: `data.csv'
>>   Size: 2271197563      Blocks: 4440280    IO Block: 4096   regular file
>>Device: 342h/834d       Inode: 9994308     Links: 1
>>Access: (0644/-rw-r--r--)  Uid: (  500/   rpeng)   Gid: (  500/   rpeng)
>>Access: 2004-08-31 09:50:04.000000000 -0400
>>Modify: 2004-08-26 19:09:42.000000000 -0400
>>Change: 2004-08-31 09:53:29.000000000 -0400
> 
> 
> Take a look at the source code for stat, in coreutils.
> 
> 
>>But, file.info() in R-devel gives me:
>>
>> > file.info("data.csv")
>>          size isdir mode mtime ctime atime uid gid uname grname
>>data.csv   NA    NA <NA>  <NA>  <NA>  <NA>  NA  NA  <NA>   <NA>
>>
>>I assume this has something to do with the underlying call to `stat' 
>>in `do_fileinfo'.
>>
>>This alone is not much of a problem but I also can't seem to be able 
>>to open a file connection to the same file.  For example,
>>
>> > con <- file("data.csv")
>> > open(con, "r")
>>Error in open.connection(con, "r") : unable to open connection
>>In addition: Warning message:
>>cannot open file `data.csv'
>>
>>Also, interestingly,
>>
>> > file.exists("data.csv")
>>[1] FALSE
>>
>>I take it all these things are related.
>>
>>Is it possible to fix this within R?  Or should there be a note in the 
>>help pages?
>>
>> > version
>>          _
>>platform i686-pc-linux-gnu
>>arch     i686
>>os       linux-gnu
>>system   i686, linux-gnu
>>status   Under development (unstable)
>>major    2
>>minor    0.0
>>year     2004
>>month    08
>>day      31
>>language R
>>
>>-roger
>>
>>______________________________________________
>>R-devel at stat.math.ethz.ch mailing list
>>https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>
> 
>



More information about the R-devel mailing list