[R] immortal connections

Pierre Kleiber pkleiber at honlab.nmfs.hawaii.edu
Fri Feb 15 00:57:26 CET 2002


  I have several data input functions that include a construct like
the following:

   indat <- function(stuff) {
     [...]
     awkp <- paste("awk ...yada yada...", stuff, etc.)
     scan(pipe(awkp),quiet=TRUE)
   }

I use these functions a lot, and as I do, a lengthening list of
closed, but undestroyed, connections accumulates.  Ultimately this
appears to stuff things up and cause error messages, such as "cannot
close output sink connection".  I seem to remember a related query
some time ago on this list, but I can't locate it.  So my question is:
Should I include a closeAllConnections() at the end of each input
function?... or is there a preferrable tactic?

  Thanks, Pierre

vital data: 
  R  Version 1.4.1  (2002-01-30)
  Red Hat Linux release 7.2 (Enigma)

-- 
-----------------------------------------------------------------
Pierre Kleiber             Email: pkleiber at honlab.nmfs.hawaii.edu
Fishery Biologist                     Tel: 808 983-5399/737-7544
NOAA FISHERIES - Honolulu Laboratory         Fax: 808 983-2902
2570 Dole St., Honolulu, HI 96822-2396 
-----------------------------------------------------------------
 "God could have told Moses about galaxies and mitochondria and
  all.  But behold... It was good enough for government work."
-----------------------------------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list