[ismrmrd] 227/281: allow IsmrmrdDataset to open HDF5 file read-only

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag ismrmrd0.5
in repository ismrmrd.

commit a0b7bac01326c5615a2a98dcdb70dcd7afd5dd29
Author: Joseph Naegele <joseph.naegele at gmail.com>
Date:   Thu Apr 24 14:08:41 2014 -0400

    allow IsmrmrdDataset to open HDF5 file read-only
---
 ismrmrd_hdf5.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/ismrmrd_hdf5.cpp b/ismrmrd_hdf5.cpp
index 1b6c362..6ca071c 100644
--- a/ismrmrd_hdf5.cpp
+++ b/ismrmrd_hdf5.cpp
@@ -19,10 +19,13 @@ int IsmrmrdDataset::openHDF5File()
 				return -1;
 			}
 			file_ = boost::shared_ptr<H5File>(new H5File(filename_.c_str(), H5F_ACC_RDWR));
-
 		} catch (...) {
-			std::cerr << "Failed to open HDF5 file." << std::endl;
-			return -1;
+                    try {
+                        file_ = boost::shared_ptr<H5File>(new H5File(filename_.c_str(), H5F_ACC_RDONLY));
+                    } catch (...) {
+                        std::cerr << "Failed to open HDF5 file." << std::endl;
+                        return -1;
+                    }
 		}
 		file_open_ = true;
 	} else if (create_file_if_needed_){

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git



More information about the debian-science-commits mailing list