Packet Table Attributes

Is there any reason why I shouldn't be able to attach an attribute to a packet table? The H5PT API Reference suggests I should be able to add it using the normal calls.

I have been unable to successfully create one at the DotNet level; and so I tried it in straight C using the ptExampleFL.c source. Before the H5PTclose(), I added:

    /* Create an attribute for the dataset */
    attr = H5Acreate2(ptable, "Attr1", H5T_NATIVE_INT, H5S_SCALAR, H5P_DEFAULT, H5P_DEFAULT);

    /* Write attribute information */
    H5Awrite(attr, H5T_NATIVE_INT, &attr_data);

    /* Close attribute */
    H5Aclose(attr);

I get these error messages:
HDF5-DIAG: Error detected in HDF5 (1.8.2) thread 0:
  #000: ..\..\..\src\H5A.c line 235 in H5Acreate2(): not a location
    major: Invalid arguments to routine
    minor: Inappropriate type
  #001: ..\..\..\src\H5Gloc.c line 241 in H5G_loc(): invalid object ID
    major: Invalid arguments to routine
    minor: Bad value
HDF5-DIAG: Error detected in HDF5 (1.8.2) thread 0:
  #000: ..\..\..\src\H5A.c line 925 in H5Awrite(): not an attribute
    major: Invalid arguments to routine
    minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.8.2) thread 0:
  #000: ..\..\..\src\H5A.c line 2283 in H5Aclose(): not an attribute
    major: Invalid arguments to routine
    minor: Inappropriate type

Scott

···

________________________________
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.

Apart from the attribute code, it is ptExampleFL.c from hl\examples.

ptable = H5PTcreate_fl(fid, "Packet Test Dataset", H5T_NATIVE_INT, (hsize_t)100, 5);

I've attached my modified copy.

In my .NET code, I can attach attributes to H5D datasets, not the H5PT datasets. I had a friend try in IDL, and he couldn't attach an attribute to a PT dataset either.

Scott

ptExampleFL.c (3.9 KB)

···

From: Binh-Minh Ribler [mailto:bmribler@hdfgroup.org]
Sent: Thursday, June 04, 2009 2:52 PM
To: Mitchell, Scott - AES
Subject: RE: [hdf-forum] Packet Table Attributes

I'm just curious, how did you declare ptable?

Binh-Minh

________________________________
From: Mitchell, Scott - AES [mailto:Scott.Mitchell@itt.com]
Sent: Thursday, June 04, 2009 12:19 PM
To: hdf-forum forum
Subject: [hdf-forum] Packet Table Attributes

Is there any reason why I shouldn't be able to attach an attribute to a packet table? The H5PT API Reference suggests I should be able to add it using the normal calls.

I have been unable to successfully create one at the DotNet level; and so I tried it in straight C using the ptExampleFL.c source. Before the H5PTclose(), I added:

    /* Create an attribute for the dataset */
    attr = H5Acreate2(ptable, "Attr1", H5T_NATIVE_INT, H5S_SCALAR, H5P_DEFAULT, H5P_DEFAULT);

    /* Write attribute information */
    H5Awrite(attr, H5T_NATIVE_INT, &attr_data);

    /* Close attribute */
    H5Aclose(attr);

I get these error messages:
HDF5-DIAG: Error detected in HDF5 (1.8.2) thread 0:
  #000: ..\..\..\src\H5A.c line 235 in H5Acreate2(): not a location
    major: Invalid arguments to routine
    minor: Inappropriate type
  #001: ..\..\..\src\H5Gloc.c line 241 in H5G_loc(): invalid object ID
    major: Invalid arguments to routine
    minor: Bad value
HDF5-DIAG: Error detected in HDF5 (1.8.2) thread 0:
  #000: ..\..\..\src\H5A.c line 925 in H5Awrite(): not an attribute
    major: Invalid arguments to routine
    minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.8.2) thread 0:
  #000: ..\..\..\src\H5A.c line 2283 in H5Aclose(): not an attribute
    major: Invalid arguments to routine
    minor: Inappropriate type

Scott

________________________________
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.