# Compression filter that employes multiple datasets

**URL:** <https://forum.hdfgroup.org/t/compression-filter-that-employes-multiple-datasets/9398>\
**Category:** HDF5 Library\
**Created:** [February 8, 2022, 2:22am UTC](https://forum.hdfgroup.org/t/compression-filter-that-employes-multiple-datasets/9398 "2022-02-08T02:22:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![lucasvr](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/lucasvr/32/1136_2.png) [@lucasvr](https://forum.hdfgroup.org/u/lucasvr)\
**Post date:** [February 20, 2022, 6:39pm UTC](https://forum.hdfgroup.org/t/compression-filter-that-employes-multiple-datasets/9398/5 "2022-02-20T18:39:18Z")

</div>

@miller86, it is possible to open another dataset from your I/O filter implementation, but it’s a bit tricky: the filter API doesn’t give you the file handle, so you won’t be able to simply H5Dopen() and call it a day.

The workarounds I use on HDF5-UDF to identify the underlying file are to [scan /proc/self/fd](https://github.com/lucasvr/hdf5-udf/blob/0961e0caf579fa148ca49792aa9b488547ea6e46/src/os_linux.cpp#L27) (on Linux), [lookup entries on /proc/fd](https://github.com/lucasvr/hdf5-udf/blob/0961e0caf579fa148ca49792aa9b488547ea6e46/src/os_macos.cpp#L21) (macOS), and [resort to Win32 APIs](https://github.com/lucasvr/hdf5-udf/blob/0961e0caf579fa148ca49792aa9b488547ea6e46/src/os_windows.cpp#L59) (Windows). Once I have a set of candidate files I [inspect each one of them](https://github.com/lucasvr/hdf5-udf/blob/0961e0caf579fa148ca49792aa9b488547ea6e46/src/io_filter.cpp#L63) for the dataset I’d like to read.

As @gheber says, most use cases I have around HDF5-UDF involve producing values for an output dataset given values from other existing datasets. If you think that UDFs might be a good fit for you, please let me know. I’ll be happy to give you pointers to get started 🙂

Best regards,  
Lucas

---

_[View the full topic](https://forum.hdfgroup.org/t/compression-filter-that-employes-multiple-datasets/9398)._
