Re: delete a dataset in a hdf file [message #34119] |
Thu, 27 February 2003 00:04 |
Klemens Barfus
Messages: 45 Registered: December 2002
|
Member |
|
|
Thanks James ! Because of your answer, I will not waste more time trying
to delete things I can not delete.
best regards
Klemens
James Kuyper wrote:
> Klemens Barfus wrote:
>
>> Hello together,
>> how can I delete a dataset in a hdf file ? I have not found anything
>> about it except a command like HDF_DELDD. Is it the right way and how do
>> I have to use it ?
>>
>
> That only removes tags and descriptors. HDF isn't really designed for
> deleting things; its design reflects a "write once, read many" attitude.
> The there are a few things that you can delete. You can use HDF_DELDD,
> and since HDF is built upon CDF, you can use NCDF_ATTDEL to delete
> attributes. However, they aren't really removed from the file;
> internally, they're marked as "no longer active", but they still use up
> space.
>
> You can emulate deletions of a dataset, by copying every part of a file,
> except the part you want deleted, to a new file. Then erase the old one,
> and change the name of the new file to match the old one. Sorry, that's
> about the best you can do.
>
|
|
|
Re: delete a dataset in a hdf file [message #34125 is a reply to message #34119] |
Wed, 26 February 2003 11:21  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
Klemens Barfus wrote:
>
> Hello together,
> how can I delete a dataset in a hdf file ? I have not found anything
> about it except a command like HDF_DELDD. Is it the right way and how do
> I have to use it ?
That only removes tags and descriptors. HDF isn't really designed for
deleting things; its design reflects a "write once, read many" attitude.
The there are a few things that you can delete. You can use HDF_DELDD,
and since HDF is built upon CDF, you can use NCDF_ATTDEL to delete
attributes. However, they aren't really removed from the file;
internally, they're marked as "no longer active", but they still use up
space.
You can emulate deletions of a dataset, by copying every part of a file,
except the part you want deleted, to a new file. Then erase the old one,
and change the name of the new file to match the old one. Sorry, that's
about the best you can do.
|
|
|
Re: delete a dataset in a hdf file [message #34127 is a reply to message #34125] |
Wed, 26 February 2003 11:04  |
Klemens Barfus
Messages: 45 Registered: December 2002
|
Member |
|
|
Ok, I tried something like these:
PRO DELETE_TEST
filename_out = 'e:\GESIMA\test_del2.hdf'
FileID_out = HDF_OPEN(filename_out, /READ)
HDF_DELDD, FileID_out, 702, 2
HDF_CLOSE, FileID_out
END
Tag 702 and Reference No 2 I got when I checked the hdf file by Noesys.
But I always get the message:
HDF_DELDD: Unable to delete the specified tag/reference pair.
Whats wrong ?
Thanks for your help in advance !
Klemens
|
|
|