Skip to content

Commit

Permalink
Fix problem where H5open() is not called
Browse files Browse the repository at this point in the history
With the latest version of the HDF5 library, opening a file doesn't call
H5open() which is required before any other call to the library. Add
manual calls to H5open().
  • Loading branch information
Alejandro Isaza committed Apr 6, 2016
1 parent 53d1d4a commit 49e5cd9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/File.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class File: GroupType {
}

public class func create(filePath: String, mode: CreateMode) -> File? {
H5open()

var id: hid_t = -1
filePath.withCString { filePath in
id = H5Fcreate(filePath, mode.rawValue, 0, 0)
Expand All @@ -27,6 +29,8 @@ public class File: GroupType {
}

public class func open(filePath: String, mode: OpenMode) -> File? {
H5open()

var id: hid_t = -1
filePath.withCString { filePath in
id = H5Fopen(filePath, mode.rawValue, 0)
Expand Down

0 comments on commit 49e5cd9

Please sign in to comment.