Re: [netcdfgroup] PDL::NetCDF cannot write to existing netcdf files

The docs don't mention an open function and I've tried various things to
find one, but it doesn't seem to exist.  In the examples on the website:

http://search.cpan.org/~dhunt/PDL-NetCDF-4.01/netcdf.pd

They have this example:

  # opening existing file for reading and writing
  $nc = PDL::NetCDF->new ("file2.nc", {MODE => O_RDWR,
                        REVERSE_DIMS => 1});

Which is what I'm doing, but I get the same error when I try to put data
(line 9 is the $nc->put).

Thanks,
Brice


Ted Mansell wrote:
> I don't know anything about PDL, but I see the function is "new" so
> maybe there is an "open" function call?  Perhaps "new" assumes that the
> file doesn't exist already and doesn't like it when it does.  (Is line 9
> the "my $nc =" or "$nc->put"?)
> 
> -- Ted
> 
> 
> On Jul 15, 2009, at 4:03 PM, Brice Lambi wrote:
>>
>>
>> my $nc = PDL::NetCDF->new("testnc.nc", {MODE=>O_RDWR|REVERSE_DIMS=>1});
>> my $data = pdl [1,2,3];
>> $nc->put('time_nominal', ['recNum'], $data);
>> $nc->close();
>>



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