Re: Unable to create netCDF file [message #75581 is a reply to message #75580] |
Thu, 31 March 2011 11:06  |
Foldy Lajos
Messages: 268 Registered: October 2001
|
Senior Member |
|
|
On Thu, 31 Mar 2011, Kenneth P. Bowman wrote:
> Any idea why I cannot create a netCDF file using tilde expansion?
>
> IDL> id = NCDF_CREATE('~/test.ncd', CLOBBER = clobber)
> % NCDF_CREATE: Unable to create the file, ~/test.ncd. (NC_ERROR=-31)
>
> I thought it was a generic problem with tilde expansion, but it works
> for plain files (the file text.txt exists and contains 'test').
>
> IDL> openw, iunit, '~/test.txt', /get_lun
> IDL> printf, iunit, 'test'
> IDL> free_lun, iunit
>
> NetCDF file creation works if I provide the fully-qualified path.
I think NCDF_CREATE does not expand path names. Your error message
indicates that the ~ directory in ~/test.ncd does not exist:
IDL> id = NCDF_CREATE('~/test.ncd', CLOBBER = clobber)
% Loaded DLM: NCDF.
% NCDF_CREATE: Unable to create the file, ~/test.ncd. (NC_ERROR=-31)
% Execution halted at: $MAIN$
IDL> $mkdir '~'
IDL> id = NCDF_CREATE('~/test.ncd', CLOBBER = clobber)
IDL> help, id
ID LONG = 5
regards,
Lajos
|
|
|