[ncl-talk] Finding out a file's path

Tom Roche Tom_Roche at pobox.com
Thu Aug 7 20:51:27 MDT 2014


http://www.ncl.ucar.edu/Support/talk_archives/2008/0230.html
[Dennis Shea Tue, 12 Feb 2008 06:33:50 -0700]
>> You can not determine the path/file to which "file" is pointing.

Is this still the case, API-wise? Because certainly a file (or as I prefer to say, a filehandle) knows its path:

$ ncl -V
6.2.0
$ ncl
ncl 0> refr_fp = "/project/inf35w/roche/met/24-layer/WRF_2008_24aL/12US1/mcip_out/METBDY3D_071222"
ncl 1> refr_fh = addfile(refr_fp, "r")
ncl 2> printVarSummary(refr_fh)

Variable: refr_fh
Type: file
File path:      /project/inf35w/roche/met/24-layer/WRF_2008_24aL/12US1/mcip_out/METBDY3D_071222
Number of global attributes:     33
Number of dimensions:    5
Number of variables:     18

http://www.ncl.ucar.edu/Support/talk_archives/2008/0233.html
[Jan Ploski Tue, 12 Feb 2008 14:38:51 +0100]
> I can pass the path used to create the file object together with the [filehandle]
> to my procedure [but it's] rather redundant and ugly

agreed! Tom Roche <Tom_Roche at pobox.com>


More information about the ncl-talk mailing list