RE: [R] error in file(file, "r"): all connections are in use

2004-05-04 Thread Vadim Ogranovich
If you open a connection within a function it is often a good idea to set an "on.exit" expression that will close the connection. This will be called even if your function terminates via stop(). Here is an example: con <- file("foo") open(con) on.exit(close(con), add=TRUE) HTH, Vadim > -O

Re: [R] error in file(file, "r"): all connections are in use

2004-05-04 Thread Prof Brian Ripley
On Tue, 4 May 2004, Lei Jiang wrote: > I am trying to read multiple files into R, but I got following message > > Error in file(file, "r"): All connections are in use. > > I clean up memory everytime I read in one file. Do i have to somehow > release file connection everytime i read in one?? No