Re: too many open files

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 10 2013 - 12:46:31 MDT

Hi Ramon,
You need to call setfileoption before you open the file. In this case the first argument to setfileoption needs to be the type of the file you are going to open ("nc").
So:
setfileoption("nc","SuppressClose", False)
then f = addfiles(.

 -dave

On Jun 7, 2013, at 11:30 PM, Ramon Docto <mondocto2@yahoo.com> wrote:

> Hello list,
>
> I am trying to construct an object in memory from (~2000) files using addfiles().
>
> I have read the documentation about avoiding excess open filehandles by using the "SuppressClose" fileoption but have not found an example explicitly showing usage.
>
> The code snippet below still fails with "too many open files" errors:
>
> fls = systemfunc ("ls " + ipath + iname + "*.nc")
> f = addfiles (fls, "r")
>
> ListSetType (f, "cat") ;; concatenate (default)
> setfileoption(f, "SuppressClose", False) ;; avoid excess open files
>
> tmax = f[:]->tmaxscr(3:239:4,{lats(0):lats(1)},{lons(0):lons(1)})
> tmin = f[:]->tminscr(3:239:4,{lats(0):lats(1)},{lons(0):lons(1)})
>
> Can anyone advise on this?
>
> Thanks,
> Ramon
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 10 12:46:43 2013

This archive was generated by hypermail 2.1.8 : Tue Jun 11 2013 - 12:03:58 MDT