Skip to content

Commit 3e2bfc5

Browse files
committed
add is_hdf5()
1 parent 59f8a16 commit 3e2bfc5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

+stdlib/is_hdf5.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
%% IS_HDF5 is file an HDF5 file?
2+
3+
function is_hdf5 = is_hdf5(filename)
4+
arguments
5+
filename {mustBeTextScalar}
6+
end
7+
8+
is_hdf5 = H5F.is_hdf5(filename) == 1;
9+
10+
end

test/TestHDF5.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ function setup_file(tc)
3838

3939
% create test data first, so that parallel tests works
4040
stdlib.h5save(bf, '/A0', A0)
41+
42+
tc.assertTrue(stdlib.is_hdf5(bf))
43+
4144
stdlib.h5save(bf, '/A1', A1)
4245
stdlib.h5save(bf, '/A2', A2)
4346
stdlib.h5save(bf, '/A3', A3, "size", size(A3))

0 commit comments

Comments
 (0)