diff --git a/wetb/hawc2/hawc2_simulation.py b/wetb/hawc2/hawc2_simulation.py index 02a583dab05b86d7d54bfdfdc16e0975ac2a3a92..84b24285d0dd0d68ab96f5593bafffc7d5a76c92 100644 --- a/wetb/hawc2/hawc2_simulation.py +++ b/wetb/hawc2/hawc2_simulation.py @@ -192,11 +192,11 @@ class Hawc2_Simulation(object): if not self.accompanying_files is None: for i, accompanying_file in enumerate(self.accompanying_files): destination = os.path.join(self.write_directory,self.accompanying_destinations[i]) - destination = os.path.abspath(os.path.realpath(destination)) - if not os.path.isfile(destination) and not os.path.isdir(destination): + if not os.path.isfile(destination) and not os.path.isdir(destination) and not os.path.islink(destination): dest_dir = os.path.dirname(destination) if not os.path.isdir(dest_dir): os.makedirs(dest_dir) + destination = os.path.abspath(os.path.realpath(destination)) os.symlink(accompanying_file, destination) # Get the directory