Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: HDF5 Hight Level API
Date: Fri, 9 Oct 2009 09:50:03 +0000 (UTC)
Organization: UPT v.v.i.
Lines: 50
Message-ID: <han10b$919$1@fred.mathworks.com>
References: <gubrmt$g57$1@fred.mathworks.com> <op.uvxg6pc7a5ziv5@uthamaa.dhcp.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1255081803 9257 172.30.248.38 (9 Oct 2009 09:50:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 9 Oct 2009 09:50:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1100235
Xref: news.mathworks.com comp.soft-sys.matlab:576174


> Meng,
> 
> Yes, as the document mentions, 'overwrite' will overwrite the entire  
> contents of the file.
> 
> To overwrite a specific dataset, just write to it again:
> 
> >> hdf5write('myfile.h5', '/dataset1', uint8(5))
> >> hdf5read('myfile.h5','/dataset1')
> 
> ans =
> 
>      5
> 
> >> hdf5write('myfile.h5', '/dataset1', uint8(10))
> >> hdf5read('myfile.h5','/dataset1')
> 
> ans =
> 
>     10

hello, 
maybe I miss the point, but IMHO the above example 
overwrites the entire contents of the file too.
An example with two datasets:

>> hdf5write('myfile.h5', '/dataset1', uint8(5))
>> hdf5write('myfile.h5', '/dataset2', uint8(5),'WriteMode', 'append') 

you have NO possibility to change the values of dataset1 without destroying dataset2:

1. try WriteMode append:
>> hdf5write('myfile.h5', '/dataset1', uint8(10),'WriteMode', 'append')
??? Error using ==> hdf5writec
writeH5Dset: Dataset names must be unique when appending data.

2. without try WriteMode append (default mode  is 'overwrite')  
>> hdf5write('myfile.h5', '/dataset1', uint8(10))
>> hdf5read('myfile.h5','/dataset1')
ans =
   10
>> hdf5read('myfile.h5','/dataset2')
??? Error using ==> hdf5readc
/dataset2 is not a dataset.

that means that the entire contents of the file was rewritten,
not only the specific dataset1.

with best wishes 
vita