File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 7
7
link (1 ,1 ) string
8
8
end
9
9
10
+ if isMATLABReleaseOlderThan(" R2024b" )
10
11
% import java.io.File
11
12
% import java.nio.file.Files
12
13
% ok = Files.createSymbolicLink(File(link).toPath(), File(target).toPath());
18
19
end
19
20
20
21
if ispc
21
- cmd = " pwsh -c " + ' "' + " New-Item -ItemType SymbolicLink -Path " + link + " -Target " + target + ' "' ;
22
+ cmd = " pwsh -c " + ' "' + " New-Item -ItemType SymbolicLink -Path " + link + ...
23
+ " -Target " + target + ' "' ;
22
24
else
23
25
cmd = " ln -s " + target + " " + link ;
24
26
end
28
30
29
31
ok = stat == 0 ;
30
32
33
+ else
34
+
35
+ try
36
+ createSymbolicLink(link , target );
37
+ ok = true ;
38
+ catch
39
+ ok = false ;
40
+ end
41
+
42
+ end
43
+
31
44
end
Original file line number Diff line number Diff line change 6
6
p (1 ,1 ) string
7
7
end
8
8
9
- import java . io . File
10
- import java . nio . file . Files
11
-
12
- % must be absolute path
13
- f = File( stdlib . fileio .absolute_path( p )).toPath( );
14
- ok = Files .isSymbolicLink( f );
9
+ if isMATLABReleaseOlderThan( " R2024b " )
10
+ % must be absolute path
11
+ ok = java . nio . file . Files .isSymbolicLink( java . io .File( stdlib . fileio .absolute_path( p )).toPath());
12
+ else
13
+ ok = isSymbolicLink( p );
14
+ end
15
15
16
16
end
You can’t perform that action at this time.
0 commit comments