From fb67ed5f422ee880f11d08f77462bdf408745c7d Mon Sep 17 00:00:00 2001
From: "M. Hock" <martin.hock@fst.tu-darmstadt.de>
Date: Tue, 1 Mar 2022 13:19:50 +0100
Subject: [PATCH] adjusted ObjectName used to create the link to not be a unix
 path

---
 +PlotID/createLinkedHDF5.m | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/+PlotID/createLinkedHDF5.m b/+PlotID/createLinkedHDF5.m
index c7caae2..547240b 100644
--- a/+PlotID/createLinkedHDF5.m
+++ b/+PlotID/createLinkedHDF5.m
@@ -12,11 +12,17 @@ end
 
 [~,filename,ext] = fileparts(SourceFile);
 
+% create GroupName to avoid internal path issues on linux/unix systems
+GroupName = split(SourceFile,filesep);
+% Using windows fileseperator for the object name
+GroupName = join(GroupName,'\');
+GroupName = GroupName{:};
+
 try
     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(['..,filesep,'data',SourceFile],'/',fid, SourceFile ,plist_id,plist_id); %original
+    H5L.create_external(['..',SourceFile],'/',fid, GroupName ,plist_id,plist_id);
+    %H5L.create_external(['..,filesep,'data',SourceFile],'/',fid, GroupName ,plist_id,plist_id); %original
     H5F.close(fid);
     disp([fullfile(TargetPath,[filename,ext]),' created']);
     status = 1;
-- 
GitLab