[h5py] 255/455: Properly handle H5FD_WINDOWS driver
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.
commit 57640420059b583954e247ebca045b3d16f3846e
Author: andrewcollette <andrew.collette at gmail.com>
Date: Sat May 30 00:26:46 2009 +0000
Properly handle H5FD_WINDOWS driver
---
h5py/h5fd.pxd | 4 +++-
h5py/h5fd.pyx | 6 +++++-
h5py/highlevel.py | 12 +++++++++---
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/h5py/h5fd.pxd b/h5py/h5fd.pxd
index ced8b14..47202f4 100644
--- a/h5py/h5fd.pxd
+++ b/h5py/h5fd.pxd
@@ -38,7 +38,9 @@ cdef extern from "hdf5.h":
hid_t H5FD_MPIO
hid_t H5FD_MULTI
hid_t H5FD_SEC2
- hid_t H5FD_STDIO
+ hid_t H5FD_STDIO
+ IF UNAME_SYSNAME == "Windows":
+ hid_t H5FD_WINDOWS
int H5FD_LOG_LOC_READ # 0x0001
int H5FD_LOG_LOC_WRITE # 0x0002
diff --git a/h5py/h5fd.pyx b/h5py/h5fd.pyx
index ea8c08c..3c6e7f6 100644
--- a/h5py/h5fd.pyx
+++ b/h5py/h5fd.pyx
@@ -37,7 +37,11 @@ LOG = H5FD_LOG
MPIO = H5FD_MPIO
MULTI = H5FD_MULTI
SEC2 = H5FD_SEC2
-STDIO = H5FD_STDIO
+STDIO = H5FD_STDIO
+IF UNAME_SYSNAME == "Windows":
+ WINDOWS = H5FD_WINDOWS
+ELSE:
+ WINDOWS = -1
# === Logging driver ==========================================================
diff --git a/h5py/highlevel.py b/h5py/highlevel.py
index 8c83629..9fbf111 100644
--- a/h5py/highlevel.py
+++ b/h5py/highlevel.py
@@ -489,7 +489,12 @@ class File(Group):
The HDF5 file driver may also be specified:
- 'sec2' (default)
+ None
+ Use the standard HDF5 driver appropriate for the current platform.
+ On UNIX, this is the H5FD_SEC2 driver; on Windows, it is
+ H5FD_WINDOWS.
+
+ 'sec2'
Unbuffered, optimized I/O using standard POSIX functions.
'stdio'
@@ -529,7 +534,8 @@ class File(Group):
def driver(self):
"""Low-level HDF5 file driver used to open file"""
drivers = {h5fd.SEC2: 'sec2', h5fd.STDIO: 'stdio',
- h5fd.CORE: 'core', h5fd.FAMILY: 'family'}
+ h5fd.CORE: 'core', h5fd.FAMILY: 'family',
+ h5fd.WINDOWS: 'windows'}
return drivers.get(self.fid.get_access_plist().get_driver(), 'unknown')
# --- Public interface (File) ---------------------------------------------
@@ -546,7 +552,7 @@ class File(Group):
"""
plist = h5p.create(h5p.FILE_ACCESS)
plist.set_fclose_degree(h5f.CLOSE_STRONG)
- if driver is not None:
+ if driver is not None and not (driver=='windows' and sys.platform=='win32'):
if(driver=='sec2'):
plist.set_fapl_sec2(**driver_kwds)
elif(driver=='stdio'):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git
More information about the debian-science-commits
mailing list