[R] File opening error after 1020 files opened

Dirk Eddelbuettel edd at debian.org
Fri Feb 28 05:28:02 CET 2003


On Thu, Feb 27, 2003 at 08:08:48PM -0800, jonathan_li at agilent.com wrote:
> The file open failed at when i=1021. So the difference in when file openning
> fails is due to the difference in system, not to the fact that I am openning
> different files each time.

It's a question for the operating system / kernel. See e.g. what I just
found via Google at

  http://www.jguru.com/faq/view.jsp?EID=239607 
	
and which answers the question "How can I increase the number of sockets and
files that I can simultaneously have open under Linux?" as follows:

  Linux 2.2.x kernels allow control of the maximum number of open files
  through the /proc/sys/fs/file-max pseudo-file. Read that file to see the
  current limits; write a new value to it to change the limit. For example:

  cat /proc/sys/fs/file-max
  echo 16384 >/proc/sys/fs/file-max
    
  You may also find it useful to manipulate the kernel inode limit. This
  is controlled, using the same techniques, through the 
  /proc/sys/fs/inode-max pseudo-file.

On my Debian systems this would appear to be set to 4096, both under 2.2 and
2.4 kernels. 

Still, what seems odd is that the pixmap library doesn't close the
filehandle after reading.  It seems to me that you should be able to 
loop endlessly over the ops open; do something; close; repeat as that
would only consume one file handle at a time.

Dirk

-- 
Prediction is very difficult, especially about the future. 
				             -- Niels Bohr




More information about the R-help mailing list