更新时间:2023-11-18 08:22:34
如果您明确打开stdin连接,则不会发生这种情况.
This does not happen if you explicitly open the stdin connection.
#!/usr/bin/env Rscript
f <- file("stdin")
open(f)
while(length(line <- readLines(f,n=1)) > 0) {
write(line, stderr())
# process line
}