Skip to content
Snippets Groups Projects
Select Git revision
  • 0c7d82741c7e543a3c85ef97c7321c6db87a482d
  • master default
  • new_rng
  • unstable
  • many_sweeps
  • hdf5
  • pemonts
7 results

mc.cpp

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