Skip to content

Getting rid of extra connections?

1 message · Don MacQueen

#
Thank you Peter,

For anyone who is interested, these two examples illustrate nicely:

## example 1
for (i in 1:50) {foo <- pipe('date') ; rm(foo) ; cat(i,' ')}
showConnections(all=T)
closeAllConnections()

## example 2
for (i in 1:50) {foo <- pipe('date') ; close(foo) ; cat(i,' ')}


I would have sworn I had tried putting that close() in there, but 
evidently I didn't. Also, I was looking at ?connections, but missed 
?showConnections. Oops.

I did figure out that I was wrong about split.screen being the cause. 
I'm actually monitoring several data files that have new data 
appended once per minute, and my current code uses pipe() like yours. 
Down the road I'm hoping to use a socket connection.
_                  
platform sparc-sun-solaris2.7
arch     sparc              
os       solaris2.7         
system   sparc, solaris2.7  
status                      
major    1                  
minor    5.1                
year     2002               
month    06                 
day      17
language R                  

-Don
At 11:00 PM +0200 10/4/02, Peter Dalgaard BSA wrote: