diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 5f6e2d8ee..8a901aebe 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -2287,6 +2287,14 @@ public class Base { */ static public void saveFile(String str, File file) throws IOException { File temp = File.createTempFile(file.getName(), null, file.getParentFile()); + try{ + // fix from cjwant to prevent symlinks from being destroyed. + File canon = file.getCanonicalFile(); + file = canon; + } catch (IOException e) { + throw new IOException("Could not resolve canonical representation of " + + file.getAbsolutePath()); + } PApplet.saveStrings(temp, new String[] { str }); if (file.exists()) { boolean result = file.delete();