File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 1212 link {mustBeTextScalar }
1313end
1414
15+ ok = false ;
1516
1617try
1718 createSymbolicLink(link , target );
2627 % see example/Filesystem.java for this working in plain Java.
2728 % see example/javaCreateSymbolicLink.m for a non-working attempt in Matlab.
2829 if stdlib .has_python()
29- py .pathlib .Path(link ).symlink_to(target );
30- ok = true ;
30+ try
31+ py .pathlib .Path(link ).symlink_to(target );
32+ ok = true ;
33+ catch e
34+ warning(e .identifier , " %s" , e .message )
35+ end
3136 elseif stdlib .dotnet_api() >= 6
3237 % https://learn.microsoft.com/en-us/dotnet/api/system.io.file.createsymboliclink
33- System .IO .File .CreateSymbolicLink(link , target );
34- ok = true ;
38+ try
39+ System .IO .File .CreateSymbolicLink(link , target );
40+ ok = true ;
41+ catch e
42+ warning(e .identifier , " %s" , e .message )
43+ end
3544 else
3645 warning(e .identifier , " %s" , e .message )
37- ok = false ;
3846 end
3947 case " Octave:undefined-function"
4048 err = symlink(target , link );
4149 ok = err == 0 ;
42- otherwise
43- warning(e .identifier , " %s" , e .message )
44- ok = false ;
50+ otherwise , warning(e .identifier , " %s" , e .message )
4551 end
4652end
4753
You can’t perform that action at this time.
0 commit comments