Skip to content

missing support for symlinks for windows #6893

Open
@tenbaht

Description

@tenbaht

unpacking a platform package fails for windows if the archive file contains a symlink.

This is because Platform.java defines the (Unix) command ln -s for this purpose and windows/Platform.java does not overload this with an equivalent definition for windows.

An example of the full error message can be found in issue report #25 on Sduino project where I use symlinks in a platform package.

Symlinks are supported since Windows Vista by the command mklink. I suggest a modification for src/processing/app/windows/Platform.java like this (untested, since I don't have all this java stuff set up here):

--- src/processing/app/windows/Platform.java	2017-10-30 11:04:26.000000000 +0100
+++ src/processing/app/windows/Platform.java.new	2017-11-06 12:16:13.167549867 +0100
@@ -212,7 +212,10 @@
     return scripts;
   }
 
+  @Override
   public void symlink(File something, File somewhere) throws IOException, InterruptedException {
+    Process process = Runtime.getRuntime().exec(new String[]{"mklink", somewhere.getAbsolutePath(), something}, null, somewhere.getParentFile());
+    process.waitFor();
   }
 
   @Override

A similar modification might be useful for hardlinks as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: IDEThe Arduino IDEIDE 1.9.x BetaRelated to the Arduino IDE Beta Buildfeature requestA request to make an enhancement (not a bug fix)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions