Re: too many open files

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed Jun 12 2013 - 11:41:30 MDT

Hi Ramon,
I agree that the documentation is fuzzy on this point. We will try to improve it.
 -dave

On Jun 11, 2013, at 3:50 AM, Ramon Docto <mondocto2@yahoo.com> wrote:

> Thanks Dave. Easy when you know how :-)
>
> Is it worth considering ammending the documentation on this? The entry
> Arguments
>
> format_or_file Either a string specifying a file format, or a reference to a file opened with addfile or addfiles.
>
>
> certainly gave me the impression that the file reference approach should be a viable alternative with addfiles().
>
> Thanks,
> Ramon
>
>
> From: David Brown <dbrown@ucar.edu>
> To: Ramon Docto <mondocto2@yahoo.com>
> Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Sent: Tuesday, 11 June 2013 4:46 AM
> Subject: Re: too many open files
>
> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jun 12 11:41:38 2013

This archive was generated by hypermail 2.1.8 : Mon Jun 24 2013 - 11:46:47 MDT