diff --git a/R/fread.R b/R/fread.R index 95e5c4a45..d997a4d9e 100644 --- a/R/fread.R +++ b/R/fread.R @@ -35,7 +35,7 @@ yaml=FALSE, autostart=NA, tmpdir=tempdir(), tz="") if (!is.character(text)) stop("'text=' is type ", typeof(text), " but must be character.") if (!length(text)) return(data.table()) if (length(text) > 1L) { - cat(text, file=(tmpFile<-tempfile(tmpdir=tmpdir)), sep="\n") # avoid paste0() which could create a new very long single string in R's memory + writeLines(text, tmpFile<-tempfile(tmpdir=tmpdir)) # avoid paste0() which could create a new very long single string in R's memory file = tmpFile on.exit(unlink(tmpFile), add=TRUE) } else {