diff --git a/source/net/sourceforge/filebot/MetaAttributeView.java b/source/net/sourceforge/filebot/MetaAttributeView.java index a97f7666..9ed455d5 100644 --- a/source/net/sourceforge/filebot/MetaAttributeView.java +++ b/source/net/sourceforge/filebot/MetaAttributeView.java @@ -19,7 +19,7 @@ public class MetaAttributeView extends AbstractMap { private final Charset encoding; public MetaAttributeView(File file) throws IOException { - Path path = file.toPath(); + Path path = file.getCanonicalFile().toPath(); while (isSymbolicLink(path)) { Path link = readSymbolicLink(path); if (!link.isAbsolute()) { diff --git a/source/net/sourceforge/tuned/FileUtilities.java b/source/net/sourceforge/tuned/FileUtilities.java index 15cf54c5..fb25e3fa 100644 --- a/source/net/sourceforge/tuned/FileUtilities.java +++ b/source/net/sourceforge/tuned/FileUtilities.java @@ -100,6 +100,10 @@ public final class FileUtilities { public static File createRelativeSymlink(File link, File target, boolean relativize) throws IOException { if (relativize) { + // make sure we're working with the full path + link = link.getCanonicalFile(); + target = target.getCanonicalFile(); + try { target = link.getParentFile().toPath().relativize(target.toPath()).toFile(); } catch (Throwable e) {