Skip to content

Commit ea0dd17

Browse files
committed
create_symlink: use powershell for Windows regardless
1 parent dac2000 commit ea0dd17

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

+stdlib/+fileio/create_symlink.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
link (1,1) string
88
end
99

10-
if isMATLABReleaseOlderThan("R2024b")
10+
if ispc || isMATLABReleaseOlderThan("R2024b")
1111
% import java.io.File
1212
% import java.nio.file.Files
1313
% ok = Files.createSymbolicLink(File(link).toPath(), File(target).toPath());
@@ -31,11 +31,14 @@
3131
ok = stat == 0;
3232

3333
else
34+
% windows requires RunAsAdmin, so we don't use this on Windows
35+
% https://www.mathworks.com/help/releases/R2024b/matlab/ref/createsymboliclink.html
3436

3537
try
3638
createSymbolicLink(link, target);
3739
ok = true;
38-
catch
40+
catch e
41+
warning(e.message)
3942
ok = false;
4043
end
4144

0 commit comments

Comments
 (0)