Index: load.R =================================================================== --- load.R (revision 56743) +++ load.R (working copy) @@ -25,6 +25,7 @@ ## Since the connection is not open this opens it in binary mode ## and closes it again. magic <- readChar(con, 5L, useBytes = TRUE) + if (length(magic)==0) stop("empty (zero-byte) file") if (!grepl("RD[AX]2\n", magic)) { ## a check while we still know the call to load() if(grepl("RD[ABX][12]\r", magic))