Skip to content

Commit 43294df

Browse files
committed
fcreate
1 parent ac72aca commit 43294df

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

+stdlib/+dotnet/create_symlink.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
function ok = create_symlink(target, link)
22

3+
ok = false;
4+
5+
if ~stdlib.exists(target) || strlength(link) == 0 || stdlib.exists(link)
6+
return
7+
end
8+
39
% https://learn.microsoft.com/en-us/dotnet/api/system.io.file.createsymboliclink
410
try
511
System.IO.File.CreateSymbolicLink(link, target);
612
ok = true;
713
catch e
814
warning(e.identifier, "%s", e.message)
9-
ok = false;
1015
end
1116

1217
end

+stdlib/+python/create_symlink.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
ok = false;
44

5-
if strlength(target) == 0 || strlength(link) == 0 || stdlib.exists(link)
5+
if ~stdlib.exists(target) || strlength(link) == 0 || stdlib.exists(link)
66
return
77
end
88

+stdlib/+sys/create_symlink.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
ok = false;
55

6-
if strlength(target) == 0 || strlength(link) == 0
6+
if ~stdlib.exists(target) || strlength(link) == 0 || stdlib.exists(link)
77
return
88
end
99

0 commit comments

Comments
 (0)