Skip to content

Commit ce57489

Browse files
committed
filesystem_type: return char
1 parent a399c3e commit ce57489

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

+stdlib/+dotnet/filesystem_type.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
function t = filesystem_type(p)
44

55
if stdlib.exists(p)
6-
t = string(System.IO.DriveInfo(stdlib.absolute(p)).DriveFormat);
6+
t = char(System.IO.DriveInfo(stdlib.absolute(p)).DriveFormat);
77
% https://learn.microsoft.com/en-us/dotnet/api/system.io.driveinfo.driveformat
88
else
9-
t = string.empty;
9+
t = '';
1010
end
1111

1212
end

+stdlib/+java/filesystem_type.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
function t = filesystem_type(p)
22

33
if stdlib.exists(p)
4-
t = string(javaMethod("getFileStore", "java.nio.file.Files", javaPathObject(p)).type);
4+
t = char(javaMethod("getFileStore", "java.nio.file.Files", javaPathObject(p)).type);
55
else
6-
t = string.empty;
6+
t = '';
77
end
88

99
end

+stdlib/+python/filesystem_type.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
function t = filesystem_type(p)
22

3-
4-
t = string.empty;
3+
t = '';
54

65
if ~stdlib.exists(p)
76
return
@@ -12,8 +11,8 @@
1211
try
1312
for part = py.psutil.disk_partitions(p)
1413
prt = part{1};
15-
if startsWith(pr, string(prt.mountpoint))
16-
t = string(prt.fstype);
14+
if startsWith(pr, char(prt.mountpoint))
15+
t = char(prt.fstype);
1716
return
1817
end
1918
end

+stdlib/+sys/filesystem_type.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function t = filesystem_type(p)
22

3-
t = string.empty;
3+
t = '';
44

55
if ~stdlib.exists(p), return, end
66

@@ -15,7 +15,7 @@
1515

1616
[s, t] = system(cmd);
1717
if s == 0
18-
t = string(strip(t));
18+
t = strip(t);
1919
end
2020

2121
end

test/TestDisk.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function test_filesystem_type(tc, Ps, all_fun)
100100
tc.verifyEqual(e.identifier, 'stdlib:hbackend:NameError', e.message)
101101
return
102102
end
103-
tc.verifyClass(t, 'string')
103+
tc.verifyClass(t, 'char')
104104

105105
if stdlib.exists(Ps)
106106
tc.assumeFalse(isempty(t) && tc.CI, "Some CI block viewing their filesystem type")

0 commit comments

Comments
 (0)