Closed HenrikBengtsson closed 3 years ago
eof_ok() should probably return TRUE for zero length files.
check_rprofile_eof <- function(files = NULL, all = FALSE, fix = TRUE, backup = TRUE, debug = FALSE) { eof_ok <- function(file) { size <- file.info(file)$size ## On Windows, symbolic links give size = 0 if (.Platform$OS.type == "windows" && size == 0L) size <- 1e9 bfr <- readBin(file, what = "raw", n = size) n <- length(bfr) if (n == 0L) return(FALSE) is.element(bfr[n], charToRaw("\n\r")) } ...
Related to #90
eof_ok() is duplicated in the code
eof_ok() should probably return TRUE for zero length files.