Re: Unable to create netCDF file [message #75580] |
Thu, 31 March 2011 11:19 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
FĂ–LDY Lajos writes:
> I think NCDF_CREATE does not expand path names. Your error message
> indicates that the ~ directory in ~/test.ncd does not exist:
Yes, I would guess it is a netCDF library thing and not
an IDL thing. Maybe IDL could expand the path before it
called the library routine.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
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
|
|
|