*Bug report:*
H5FDsec2.c : line 337 is:
 if((fd = HDopen(name, o_flags, 0666)) < 0)

The 0666 for the file permissions is not valid for MSVC std lib _open()
which is waht HDopen is defined as. It happens to hit the important bits,
but just by luck. It should be (_S_IREAD | _S_IWRITE) for MSVC. This could
be done in the HDopen macro with a 1 line change (assuming sys/stat.h is
included already).


*File locking on windows:*

I wanted files that are open for read-write to deny other writers. To do
this I replaced the HDopen() line in H5FDsec2.c with this:

#include <share.h>
int sh_flags = ((H5F_ACC_RDWR & flags) || (H5F_ACC_CREAT & flags))  ?
_SH_DENYWR : _SH_DENYNO;
if((fd = _sopen(name, o_flags|_O_BINARY, sh_flags, _S_IREAD|_S_IWRITE)) <
0) {
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to