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

About this list Date view Thread view Subject view Author view Attachment view

From: Prof Brian Ripley (ripley@stats.ox.ac.uk)
Date: Wed 05 May 2004 - 07:06:54 EST


Message-id: <Pine.LNX.4.44.0405042204000.9193-100000@gannet.stats>

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, but you do need to release them eventually -- call close().
Your OS will also have a limit on the number of files you can have open at
any one time, and it may not be much greater than the number of
connections that can be in use (around 50).

I cannot imagine needing more than 50 connections open at once, but if you
do you can alter the limit and recompile R.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:07 EST