[Rd] load.R patch suggestion

Ben Bolker
Thu, 15 Sep 2011 09:03:26 -0000

Inspired by

http://stackoverflow.com/questions/7487778/could-you-tell-me-what-this-error-means

I wrote the following very small (one-line) patch which returns an
*informative* error message when R tries to load a zero-byte file rather
than

Error in if (!grepl("RD[AX]2\n", magic)) { : argument is of length
zero

  I would guess that error messages with the word "magic" in them
would
be disturbing to new users, who are probably worried already that R is
magic ...

  Ben Bolker

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: load.R.txt
URL:
<https://stat.ethz.ch/pipermail/r-devel/attachments/20110915/8bfee80d/attachment.txt>