Re: Unable to put open dataset into define mode

>To: russ@xxxxxxxxxxxxxxxx
>From: James Adams <james_adams@xxxxxxxxx>
>Subject: Re: 20020624: Unable to put open dataset into define mode

Hi James,

> I am trying to put a dataset into define mode but I
> get an error status of -39.  I can't find where the
> error codes are defined in the documentation so I'm
> pretty clueless as to why this is happening.  I am
> using the NetCDF v3.0 C interface in a C++ program. 
> The relevant code is included below.  Thanks for any
> suggestions as to how to get around this.

To get the text explanation of an error return code, you can print the
string returned from the documented function nc_strerror(), as in:

   std::cout << "status: " << status << " means\n" <<
                nc_strerror(status) << "\n" ;

which will output

   status: -39 means
   Operation not allowed in define mode

The meaning of the error is that the file is already in define mode
(since it was just created with a call to nc_create()), so you cannot
call nc_redef() to put it in define mode.

Also as a reminder, usage questions about netCDF should generally be
sent to support@xxxxxxxxxxxxxxxx rather than the netcdfgroup mailing
list, which is intended for announcements and discussion.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
russ@xxxxxxxxxxxxxxxx                     http://www.unidata.ucar.edu

  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: