Skip to content

Commit 1f96077

Browse files
committed
owner: use missing
1 parent 7cab753 commit 1f96077

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

+stdlib/+dotnet/get_owner.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
% This is not yet possible with .NET on Unix, even with .NET 10.
66
% It would require Pinvoke or external Mono.Unix
77

8-
o = '';
8+
o = missing;
99

1010
try
1111
ntAccountType = System.Type.GetType('System.Security.Principal.NTAccount');

+stdlib/+java/get_owner.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
% https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/nio/file/Files.html#getOwner(java.nio.file.Path,java.nio.file.LinkOption...)
77
% https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/nio/file/LinkOption.html
88

9-
n = '';
9+
n = missing;
1010
if stdlib.strempty(file)
1111
return
1212
end

+stdlib/+python/get_owner.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function n = get_owner(file)
22

3-
n = '';
3+
n = missing;
44

55
if stdlib.strempty(file)
66
return

+stdlib/+shell/get_owner.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function [o, cmd] = get_owner(file)
22

3-
o = '';
3+
o = missing;
44

55
if ispc()
66
cmd = sprintf('pwsh -c "if($x=Get-Acl -Path ''%s'') {$x.Owner}"', file);

+stdlib/get_owner.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
backend (1,:) string = ["java", "dotnet", "python", "shell"]
1414
end
1515

16-
r = '';
16+
r = missing;
1717

1818
for b = backend
1919
switch b
@@ -31,7 +31,7 @@
3131
error('stdlib:get_owner:ValueError', 'Unknown backend: %s', b)
3232
end
3333

34-
if ~isempty(r)
34+
if ~ismissing(r)
3535
return
3636
end
3737
end

test/TestDisk.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,16 @@ function test_inode(tc, Ps, B_jps)
196196
function test_owner(tc, Ps, B_jdps)
197197
[o, b] = stdlib.get_owner(Ps, B_jdps);
198198
tc.assertMatches(b, B_jdps)
199-
tc.verifyClass(o, 'char')
200199

201200
if ismember(B_jdps, stdlib.Backend().select('get_owner'))
202201
if ~stdlib.exists(Ps)
203-
tc.verifyEqual(o, '')
202+
tc.verifyEqual(o, missing)
204203
else
204+
tc.verifyClass(o, 'char')
205205
tc.verifyGreaterThan(strlength(o), 0)
206206
end
207207
else
208-
tc.verifyEmpty(o)
208+
tc.verifyEqual(o, missing)
209209
end
210210

211211
end

0 commit comments

Comments
 (0)