[R] checking whether a file is empty

Faheem Mitha faheem at email.unc.edu
Wed Apr 30 17:53:07 CEST 2008

On Wed, 30 Apr 2008, Prof Brian Ripley wrote:

> What is wrong with
>> file.create("foo")
> [1] TRUE
>> file.info("foo")$size
> [1] 0
>> file.remove("foo")
> ?

Thanks, that works for me.

> I really wonder what searches you did: help.search("file") come up with 
> file.info.

I did a Google search for "R check file empty", "R check file size" and 
similar. Then I tried one of those R specific searches you can find on the 

Then I did a help.search("empty"). Probably not the best search term. It 
didn't occur to me to search for "file".

More information about the R-help mailing list