Skip to content
Snippets Groups Projects
Select Git revision
  • a620cbf6f1149278dff986d451d171e28ad92af2
  • master default protected
  • gitkeep
  • development protected
  • QRCode/Size
  • sync-link-hdf5
  • feature/multi-scriptpaths
  • dev/plotID_Class
  • doc
  • V1.0.1
  • V1.0
  • V1.0-RC1
  • V0.2.2
  • V0.2.1
  • V0.2-RC1
  • V0.1
16 results

createLinkedHDF5.m

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    createLinkedHDF5.m 928 B
    function [status] = createLinkedHDF5(SourceFile,TargetPath,ID)
    %createLinkedHDF5 creates a HDF file that references the Sourcefile
    %   TargetPath is the storage location, ID the foldername
    %   Status returns true if the function was sucessfull
    
    plist_id = 'H5P_DEFAULT';
    
    %catches error of wrong file type
    if iscell(SourceFile)
        SourceFile = SourceFile{1};
    end
    
    [~,filename,ext] = fileparts(SourceFile);
    
    % try
        %old
        %fid = H5F.create(fullfile(TargetPath,ID,[ID,'_data.h5']));
        
        fid = H5F.create(fullfile(TargetPath,ID,[filename,ext]));
        %create External Link to Sourcefile in the Group linkToExternal
        H5L.create_external(['..\data\',SourceFile],'/',fid, SourceFile ,plist_id,plist_id);
        H5F.close(fid);
        disp([fullfile(TargetPath,ID,[filename,ext]),' created']);
        status = 1;
    % catch
    %     warning('No linked HDF file was created');
    %     status = 0;
    % end
    
    end