Open HDF5 when it is already opened in HDFVIEW



I’ve encountered a problem when I try to open file from C library while the file is already opened in HdfView I get the exception: Unable to open file... (Virtual File Layer) Unable to lock file

I’ve read some information about file open.

Is there a way (probably file access property) to open the file multiple times (especially when it is opened in HdfView) and allow to read/write it? May the problem be solved if I build hdf5 with multithreads option ON ?

Even if this is not safe way of working with HDF5 I need to get more understanding what is blocking the file and how should I work with it


Platform? HDFView/HDF5 Versions? It’s more to do with file locking. We talked about it during one of the HDF clinics in June. OK?



Thank you for response

Hdf5 1.12, HDFView 3.1.3, Ubuntu 20.04 but I’m working on crossplatform app thus I’m interested in crossplatform solution.

Thank you for the link, I’m looking it now


Setting HDF5_USE_FILE_LOCKING env var to the string “FALSE” solves the issue.

I leave few useful links to refer to them in the future:
file locking description
file acces property that controls file locking
SWMR (single writer multiple readers) doc with example