arduino / arduino/Arduino

missing support for symlinks for windows

Open
#6,893 0 comments 0 reactions 0 assignees View on GitHub
Component: IDE feature request IDE 1.9.x Beta
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/tenbaht/sduino/issues/25) 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):

```diff
--- 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.

Contributor guide

Open the contributing guide

Research direction

Start with src/processing/app/Platform.java and src/processing/app/windows/Platform.java, then compare the existing Unix symlink command with the Windows platform implementation. Verify unpacking a platform package containing a symlink on Windows, and consider whether the related hardlink path also needs equivalent support.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.