[R] File opening error after 1020 files opened

Roger Bivand Roger.Bivand at nhh.no
Fri Feb 28 08:49:03 CET 2003


On Thu, 27 Feb 2003, Dirk Eddelbuettel wrote:

> 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.

Since I wrote that bit of pixmap, could I ask that people report which
version they are using (help(package=pixmap))? If you are using 0.3-1, you
will see that function read.pnm() makes a connection to a file, opens it,
reads it, and closes the connection. I don't have a copy of 0.3-0 to hand,
but believe it did the same. Could you please confirm that we are all
looking at 0.3-1?

Roger

> 
> Dirk
> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no




More information about the R-help mailing list