Skip to content
Snippets Groups Projects

Bugfix

Merged Lemmer, Jan requested to merge jan.lemmer-master-patch-87059 into master
1 file
+ 10
11
Compare changes
  • Side-by-side
  • Inline
+ 10
11
function [status] = createLinkedHDF5(SourceFile,TargetPath,ID)
function [status] = createLinkedHDF5(SourceFile,TargetPath)
%createLinkedHDF5 creates a HDF file that references the Sourcefile
% TargetPath is the storage location, ID the foldername
% Status returns true if the function was successfull
@@ -12,21 +12,20 @@ end
[~,filename,ext] = fileparts(SourceFile);
% try
try
%old
%fid = H5F.create(fullfile(TargetPath,ID,[ID,'_data.h5']));
fid = H5F.create(fullfile(TargetPath,ID,[filename,ext]));
fid = H5F.create(fullfile(TargetPath,[filename,ext]));
%create External Link to Sourcefile in the Group linkToExternal
H5L.create_external(['..\',SourceFile],'/',fid, SourceFile ,plist_id,plist_id);
%H5L.create_external(['..\data\',SourceFile],'/',fid, SourceFile ,plist_id,plist_id); %original
H5L.create_external(['..',SourceFile],'/',fid, SourceFile ,plist_id,plist_id);
%H5L.create_external(['..',filesep,'data',filesep,SourceFile],'/',fid, SourceFile ,plist_id,plist_id); %original
H5F.close(fid);
disp([fullfile(TargetPath,ID,[filename,ext]),' created']);
disp([fullfile(TargetPath,[filename,ext]),' created']);
status = 1;
% catch
% warning('No linked HDF file was created');
% status = 0;
% end
catch
warning('No linked HDF file was created');
status = 0;
end
end
Loading