Re: length of full path

From: Fang, Fan (GSFC-610.2)[ADNET SYSTEMS INC] <fan.fang-1_at_nyahnyahspammersnyahnyah>
Date: Thu Jun 10 2010 - 15:01:16 MDT

Thanks Dave. When and what version of NCL will this fix be released?

-Fan
________________________________________
From: David Brown [dbrown@ucar.edu]
Sent: Thursday, June 10, 2010 3:12 PM
To: Fang, Fan (GSFC-610.2)[ADNET SYSTEMS INC]
Cc: ncl-talk NCL
Subject: Re: length of full path

Hi Fan,

This problem has now been fixed. The length limit for pathnames of
output graphics files (including the output type suffix) is now
uniformly set at 254 characters. The problem with the GSN routines
stemmed from the fact that they use the base name specified for the
output as a name for the graphic objects created. This is because the
specified name is also used to look for script-specific resource
files, which are expected to have the same base name. The limit for
these graphics object names was generally set to 128, but in the case
of the XyPlot, for some reason, there was hard-coded limit of 80
characters, which lead to the problem you encountered. Now if the
overall limit of 254 characters is exceeded, a fatal error message is
returned and the seg fault should be eliminated.
  -dave

On Jun 7, 2010, at 6:06 AM, Fan Fang wrote:

> I found that the limit actually has nothing to do with looping several
> plots. It seems to exist and be much smaller for a simple xy-plot,
> when
> loading the additional "gsn_csm.ncl". It is consistent with what I
> found from the more complicated time series script - 85 characters
> in my
> Linux system including the ".eps" extension.
>
> Is there any way in NCL to enlarge this limit?
>
> -Fan
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
>
> nchar = 82 ; FAIL
> nchar = 81
>
> N=100
> x = new(N, integer)
> y = new(N, integer)
> do i=0,N-1
> x(i) = rand()
> y(i) = rand()
> end do
>
> char = new ( nchar, "character")
> ca = stringtochar("a")
> char = ca(0)
>
> pltName = chartostring( char )
> pltType = "eps"
>
> res = True
>
> wks = gsn_open_wks(pltType, pltName)
> plot = gsn_csm_xy(wks,x,y,res)
>
> Dennis Shea wrote:
>> It appears to be 220 characters on my MAC.
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>
>>
>> ;nchar = 221 ; FAIL
>> nchar = 220
>>
>> char = new ( nchar, "character")
>> ca = stringtochar("a")
>> char = ca(0)
>>
>> pltName = chartostring( char )
>> pltType = "eps"
>>
>> wks = gsn_open_wks(pltType, pltName)
>> gsn_draw_colormap(wks)
>>
>>
>> On 6/4/10 8:51 AM, Fang, Fan (GSFC-610.2)[ADNET SYSTEMS INC] wrote:
>>
>>> What is the character limit of a full path name of a graphic
>>> output file (e.g. .eps file) that can be specified in NCL?
>>>
>>> We had "segmentation fault" if the file name with path is too long.
>>>
>>> -Fan
>>> _______________________________________________
>>> 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 Thu Jun 10 15:02:28 2010

This archive was generated by hypermail 2.1.8 : Fri Jun 11 2010 - 09:33:23 MDT