Hello Bernd and BioC people:

Writing empty character strings results in a C-level HDF5 error starting in
rhdf5 2.8.0. See transcript below, under 2.8.0 (I am not attaching the
transcript under 2.7.3, where it works fine). I didn't test if this is
specific to character or would happen with other types.

I noticed in NEWS the note "h5createDataset automatically uses chunking and
compression." in 2.8.0 so this may be related to that change.

A workaround is to call h5createDataset and explicitly provide chunk = NULL
(and level = 0 to suppress warning about compression requiring chunking).
This should be done just before calling h5write.

> library(rhdf5)
> filename <- tempfile(fileext = ".hdf5")
> datasetname <- "empty_char"
> h5createFile(filename)
[1] TRUE
> h5write(character(0),
+         file = filename,
+         name = datasetname)
HDF5-DIAG: Error detected in HDF5 (1.8.10) thread 0:
  #000: H5Pdcpl.c line 867 in H5Pset_chunk(): all chunk dimensions must be
positive

    major: Invalid arguments to routine
    minor: Out of range
HDF5-DIAG: Error detected in HDF5 (1.8.10) thread 0:
  #000: H5D.c line 170 in H5Dcreate2(): unable to create dataset


    major: Dataset
    minor: Unable to initialize object
  #001: H5Dint.c line 439 in H5D__create_named(): unable to create and link
to dataset

    major: Dataset
    minor: Unable to initialize object
  #002: H5L.c line 1638 in H5L_link_object(): unable to create new link to
object

    major: Links
    minor: Unable to initialize object
  #003: H5L.c line 1882 in H5L_create_real(): can't insert link


    major: Symbol table
    minor: Unable to insert object
  #004: H5Gtraverse.c line 861 in H5G_traverse(): internal path traversal
failed

    major: Symbol table
    minor: Object not found
  #005: H5Gtraverse.c line 641 in H5G_traverse_real(): traversal operator
failed

    major: Symbol table
    minor: Callback failed
  #006: H5L.c line 1685 in H5L_link_cb(): unable to create object


    major: Object header
    minor: Unable to initialize object
  #007: H5O.c line 3015 in H5O_obj_create(): unable to open object


    major: Object header
    minor: Can't open object
  #008: H5Doh.c line 293 in H5O__dset_create(): unable to create dataset


    major: Dataset
    minor: Unable to initialize object
  #009: H5Dint.c line 1001 in H5D__create(): filters can only be used with
chunked layout

    major: Dataset
    minor: Bad value
HDF5: unable to create dataset
HDF5-DIAG: Error detected in HDF5 (1.8.10) thread 0:
  #000: H5D.c line 334 in H5Dopen2(): not found


    major: Dataset
    minor: Object not found
  #001: H5Gloc.c line 430 in H5G_loc_find(): can't find object


    major: Symbol table
    minor: Object not found
  #002: H5Gtraverse.c line 861 in H5G_traverse(): internal path traversal
failed

    major: Symbol table
    minor: Object not found
  #003: H5Gtraverse.c line 641 in H5G_traverse_real(): traversal operator
failed

    major: Symbol table
    minor: Callback failed
  #004: H5Gloc.c line 385 in H5G_loc_find_cb(): object 'empty_char' doesn't
exist

    major: Symbol table
    minor: Object not found
HDF5: unable to open dataset
Error : Error in h5checktype(). Argument not of class H5IdComponent.
In addition: Warning messages:
1: In max(nchar(obj)) : no non-missing arguments to max; returning -Inf
2: In H5Tset_size(tid, size) : NAs introduced by coercion
Error : Error in h5checktype(). Argument not of class H5IdComponent.
Error in is(h5id, "H5IdComponent") : object 'h5spaceFile' not found
Error : Error in h5checktype(). Argument not of class H5IdComponent.
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rhdf5_2.8.0

loaded via a namespace (and not attached):
[1] zlibbioc_1.10.0

	[[alternative HTML version deleted]]

