[R] about sink and scan

From: Michael S <michael_shen_at_hotmail.com>
Date: Tue 10 May 2005 - 17:48:02 EST


Hi All r-helper,

my question like this:
I use "sink" function to get output into one file,during the sink process , output keep writing into this file,I want to check is there any new output write into this file(which "sink function create"), using "scan" function to read new output from that file.
if I use the cat with "\n" ,and scan(....,skip=linenumber) ,I can get what I want.but I just use "cat" without "\n",every new output just append at the end of last output. I can not use skip option in scan function . what should I do ?
I know file.info(..)$size can get current size of file. but how can I check which is new output or old one within the same line ,then scan the latest.

example:
sink('test.txt')
cat("r sink")
scan('text.txt',what='character',blank.lines.skip=FALSE,sep='\\n',skip=0,quiet=TRUE) cat("htuierghtue")
scan#this time I just want to scan the "htuierghtue" sink()

thanks in advance



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 10 17:53:17 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:40 EST