grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
60 stars 21 forks source link

h5listIdentifier() does not return linked h5 files #82

Closed kjfuller06 closed 3 years ago

kjfuller06 commented 3 years ago

I use the rGEDI package to download and read h5 files. Sourcecode for the function reads:

readLevel1B <-function(level1Bpath) {
  level1b_h5 <- hdf5r::H5File$new(level1Bpath, mode = 'r')
  level1b<- new("gedi.level1b", h5 = level1b_h5)
  return(level1b)
}

Once the file is read in, there is no way to delete the file until RStudio is terminated. I've tried the following functions to get the file to unlink so it can be deleted but nothing works:

file$close_all()
h5closeAll()
H5close(file)

When I use h5listIdentifier() it does not return any open h5 files:

[1] type name
<0 rows> (or 0-length row.names)

Any idea what's going on or how I might solve this?