Skip to content
Snippets Groups Projects
Commit a620cbf6 authored by Lemmer, Jan's avatar Lemmer, Jan
Browse files

fixed some minor Issues

parent 5b845747
No related branches found
No related tags found
2 merge requests!13PreRelease_V0.1,!12PreRelease_V0.1
...@@ -97,9 +97,15 @@ switch options.Method ...@@ -97,9 +97,15 @@ switch options.Method
PlotID.createLinkedHDF5(sourcePath,storPath,ID); PlotID.createLinkedHDF5(sourcePath,storPath,ID);
end end
else % no identical file exists else % no identical file exists
%Copy the file in data
PlotID.createFileCopy(DataPaths.rdata{i},'data',storPath,ID,'dataCentral'); PlotID.createFileCopy(DataPaths.rdata{i},'data',storPath,ID,'dataCentral');
end %WIP
end % if contains(DataPaths.rdata{i},{'.h5','.hdf5'}) % Linking only for HDF5
% % and create linked files in the plot folder
% PlotID.createLinkedHDF5(DataPaths.rdata{i},storPath,ID);
% end %if
end %if
end %for
case 'individual' case 'individual'
% Create a copy of the research data % Create a copy of the research data
PlotID.createFileCopy(DataPaths.rdata,folderName,storPath,ID, 'data'); PlotID.createFileCopy(DataPaths.rdata,folderName,storPath,ID, 'data');
......
...@@ -15,8 +15,10 @@ function [] = createFileCopy(filePaths,folderName,storPath,ID,type) ...@@ -15,8 +15,10 @@ function [] = createFileCopy(filePaths,folderName,storPath,ID,type)
switch type switch type
case 'data' case 'data'
sufix = '_data'; newfile = sprintf([name,ext]); %keep original name
newfile = sprintf([ID, sufix, '_' , num2str(i) ,ext]); %old behaviour
%sufix = '_data';
%newfile = sprintf([ID, sufix, '_' , num2str(i) ,ext]);
case 'dataCentral' case 'dataCentral'
%keep original name %keep original name
newfile = sprintf([name,ext]); newfile = sprintf([name,ext]);
......
...@@ -10,11 +10,17 @@ if iscell(SourceFile) ...@@ -10,11 +10,17 @@ if iscell(SourceFile)
SourceFile = SourceFile{1}; SourceFile = SourceFile{1};
end end
[~,filename,ext] = fileparts(SourceFile);
% try % try
fid = H5F.create(fullfile(TargetPath,ID,[ID,'_data.h5'])); %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 %create External Link to Sourcefile in the Group linkToExternal
H5L.create_external(['..\data\',SourceFile],'/',fid, SourceFile ,plist_id,plist_id); H5L.create_external(['..\data\',SourceFile],'/',fid, SourceFile ,plist_id,plist_id);
H5F.close(fid); H5F.close(fid);
disp([fullfile(TargetPath,ID,[filename,ext]),' created']);
status = 1; status = 1;
% catch % catch
% warning('No linked HDF file was created'); % warning('No linked HDF file was created');
......
...@@ -24,7 +24,14 @@ for i=1:height(fileList) ...@@ -24,7 +24,14 @@ for i=1:height(fileList)
end end
filepath = fullfile(fileList{i,'folder'},fileList{i,'name'}); filepath = fullfile(fileList{i,'folder'},fileList{i,'name'});
%% old
%crucial performance due to matlab bug
%(see
%https://de.mathworks.com/matlabcentral/answers/338553-performance-of-system-dos-function)
if ispc if ispc
filename = ['"',filename,'"'];% Bugfix for spaces in path
[status,~] = system(['fc ' filename ' ' char(filepath)]); [status,~] = system(['fc ' filename ' ' char(filepath)]);
% 0 -> identical, 1 -> not identical % 0 -> identical, 1 -> not identical
status = ~status; % false (not identical), true(identical) status = ~status; % false (not identical), true(identical)
...@@ -34,9 +41,12 @@ for i=1:height(fileList) ...@@ -34,9 +41,12 @@ for i=1:height(fileList)
else else
warning('Platform not supported') warning('Platform not supported')
end end
%%
if status == 1 if status == 1
id(i) = 1; id(i) = 1;
id =logical(id); %bugfix
return;
else else
% Status can also be any other number e.g. 2 % Status can also be any other number e.g. 2
id(i) = 0; id(i) = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment