Hi Sergey I have implemented a file locking mechanism which is also platform independent. The only way to make it work is that you take the file handle form the hdf driver and put the lock on the first byte. This means that locking is coordinated between processes that respect this convention. It is not risk-free though you need to make sure that between opening the file and locking the file nobody else has written anything. I do this (although I have to check my cod for details) by waiting for a shared lock on a different handle, once I have this I go ahead and open the real hdf5 handle, release the first lock and make a new lock. This also implies that there is only one writer allowed...
HTH -- dimitris 2013/2/19 Sergey Spiridonov <[email protected]> > Hi all. > > I need to perform file locking on hdf5 file, because it is in use by > several applications. Right now I implement my own driver and set it via > the H5::FileAccPropList::**setDriver(). This is not very convenient way > to implement locking, because I become dependent on some internal hdf5 > structures and not portable between hdf5 versions. > > Is there more simple way to perform file locking when HDF5 file is opened? > > If there is no such a way, may be you can add some callback which will be > called just after file is opened by hdf5 library? > -- > Best regards, Sergey Spiridonov > > > ______________________________**_________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://mail.hdfgroup.org/**mailman/listinfo/hdf-forum_**hdfgroup.org<http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org> >
_______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
