h5ltset_attribute_string_f and traiing blanck characters

Elena,

Thanks a lot for your answer.
I tried my program with hdf5 1.8.4 and the output is OK.

Best regards,

Cyril.

----- Mail Original -----

···

De: "Elena Pourmal" <epourmal@hdfgroup.org>
À: hdf-forum@hdfgroup.org
Envoyé: Mardi 1 Décembre 2009 01h03:49 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: Re: [Hdf-forum] h5ltset_attribute_string_f and traiing blanck characters

Cyril,

Could you please try 1.8.4 release? There were several bugs fixed in HL Fortran APIs. I tried your program and don't see any problems. Here is the output (but may be I am missing something :)?)

Elena

epourmal@jam epourmal]$ h5dump my.h5
HDF5 "my.h5" {
GROUP "/" {
   ATTRIBUTE "first_attribute" {
      DATATYPE H5T_STRING {
            STRSIZE 16;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
      DATASPACE SCALAR
      DATA {
      (0): "first_attribute"
      }
   }
   ATTRIBUTE "m√™me avec un accent" {
      DATATYPE H5T_STRING {
            STRSIZE 25;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
      DATASPACE SCALAR
      DATA {
      (0): "m\37777777742\37777777610\37777777632\37777777742\37777777604\37777777642me avec un accent"
      }
   }
   ATTRIBUTE "second_attribute" {
      DATATYPE H5T_STRING {
            STRSIZE 17;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
      DATASPACE SCALAR
      DATA {
      (0): "second attribute"
      }
   }
   ATTRIBUTE "une autre histoire" {
      DATATYPE H5T_STRING {
            STRSIZE 19;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
      DATASPACE SCALAR
      DATA {
      (0): "une autre histoire"
      }
   }
}
}

On Nov 27, 2009, at 6:12 AM, cyril.giraudon@free.fr wrote:

Hello,

I use the HDF5 lite API with HDF5 1.8.3 compile with gcc and ifort 11.1 (ubuntu 9.04).

The h5ltset_attribute_string_f adds a string attribute to a node.

It seems I can't control trailing blank characters even if I use the fortran trim function, the attribute is often followed by strange characters.

I join a test fortan file to show how I use h5ltset_attribute_string_f.
The program take a parameter : a generated HDF5 file.

program output_file.h5

Thanks a lot,

Cyril Giraudon.

<set_attribute_string_test.f90>_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org