diff --git a/+PlotID/Publish.m b/+PlotID/Publish.m index 346dad077bb1f55b873781650cb25309b99e1a8b..6366dc81dd5a1e8be5ee6214f1757e8165dc1dd1 100644 --- a/+PlotID/Publish.m +++ b/+PlotID/Publish.m @@ -128,8 +128,7 @@ switch options.Method fList.path = fullfile(fList.folder,fList.name); sourcePath = fList{idx,'path'}; relativeSourcePath = strrep(sourcePath,currentPath,''); - - %WIP relative PATh!! + if contains(sourcePath,{'.h5','.hdf5'}) % Linking only for HDF5 PlotID.createLinkedHDF5(relativeSourcePath{1,1},storPath,ID); end diff --git a/+PlotID/createFileCopy.m b/+PlotID/createFileCopy.m index 1945690b10455ac2682fc222149ba3306666449c..a6c89593ecae599d7fa4471aa1c806e899e16446 100644 --- a/+PlotID/createFileCopy.m +++ b/+PlotID/createFileCopy.m @@ -34,7 +34,6 @@ function [storagePaths] = createFileCopy(filePaths,folderName,storPath,ID,type) error([type,' is not a valid type for createFileCopy']) end %switch - % Write the file RemotePath = fullfile(storPath,folderName, newfile); % Check if remote file already exists @@ -50,8 +49,22 @@ function [storagePaths] = createFileCopy(filePaths,folderName,storPath,ID,type) else RemotePath = fullfile(storPath,folderName,... [name(1:end-length(num2str(count))),num2str(count),ext]); - end - warning('Filename already exists in data folder'); + end + [~, name, ~] = fileparts(RemotePath); + + + msg = ['Filename ',name,... + ' already exists in the data folder' newline,... + ' PlotID will add an suffix if you continue.' newline,... + ' This can cause serious confusions.']; + warning(msg); + m = input('Do you want to continue, Y/N [Y]:','s'); + + if ismember(m,{'N','n'}) + errorMSG = ['Filename already exists in data folder.' newline,... + ' Rename the File and restart PlotID.']; + error(); + end end copyfile(FileNameAndLocation,RemotePath); storagePaths{i} = RemotePath; @@ -59,6 +72,8 @@ function [storagePaths] = createFileCopy(filePaths,folderName,storPath,ID,type) disp([type, ' sucessfully published']); catch warning([type,' export was not sucessful']) + if exist('errorMSG') + error(errorMSG); end %try end diff --git a/+PlotID/fileCompare.m b/+PlotID/fileCompare.m index cbe13744c67f42bf0425e7cf6373fb7172512ae8..8317328dc5e5d0bd815171898c99ad281ef4d131 100644 --- a/+PlotID/fileCompare.m +++ b/+PlotID/fileCompare.m @@ -26,23 +26,6 @@ for i=1:height(fileList) 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 -% filename = ['"',filename,'"'];% Bugfix for spaces in path -% status = comparejava -% % system call that causes performance issues -% [status,~] = system(['fc ' filename ' ' char(filepath)]); -% % 0 -> identical, 1 -> not identical -% status = ~status; % false (not identical), true(identical) -% -% elseif isunix %untested! -% [status,~] = system(['diff ' filename ' ' filepath]); -% else -% warning('Platform not supported') -% end %% comparison with java function % TODO test paths with spaces status = comparejava(filename, char(filepath));