comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Unable to create netCDF file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Unable to create netCDF file [message #75580] Thu, 31 March 2011 11:19
David Fanning is currently offline  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 Go to previous message
Foldy Lajos is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Unable to create netCDF file
Next Topic: NetCDF tools

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:49:55 PDT 2025

Total time taken to generate the page: 0.00456 seconds