Displaying 1 result from an estimated 1 matches for "rlconn".
Did you mean:
rconn
2024 Oct 27
0
readLines on open connection reads only first write on MacOS
...rds,
Martin
## Program to demonstrate the behaviour
## input data
rL <- list(paste0("Line ", 1:4), paste0("Line ", 1:3), paste0("Line ", 1:2))
## create an empty file and open write and read connections to the file
close(file("rL.log",open="w"))
rLconn.w <- file("rL.log", open="a")
rLconn.r <- file("rL.log", open="r")
## write the test data and read it
for (i in 1:3) {
writeLines(rL[[i]], rLconn.w)
flush(rLconn.w)
out <- readLines(rLconn.r, warn=FALSE)
writeLines(c(paste0("inpu...