Skip to content

Commit 72bce56

Browse files
committed
disk_capacity: python optional
1 parent 982d9b3 commit 72bce56

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

+stdlib/disk_capacity.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
f = uint64(0);
1212
if ~stdlib.exists(d), return, end
1313

14-
if stdlib.has_dotnet()
14+
if stdlib.has_python()
15+
di = py.shutil.disk_usage(d);
16+
f = uint64(di.total);
17+
elseif stdlib.has_dotnet()
1518
f = System.IO.DriveInfo(stdlib.absolute(d)).TotalSize();
1619
% https://learn.microsoft.com/en-us/dotnet/api/system.io.driveinfo.totalsize
1720
elseif stdlib.has_java()

buildfile.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,14 @@ function build_exe(context)
263263
srcs = {
264264
"src/remove.cpp", ...
265265
["src/normalize.cpp", normal], ...
266-
"src/disk_capacity.cpp", ...
267266
"src/set_permissions.cpp", ...
268267
};
269268

270269
if ~stdlib.has_python() || build_all
271270
srcs{end+1} = "src/is_char_device.cpp";
272271
srcs{end+1} = ["src/is_admin.cpp", "src/admin_fs.cpp"];
273272
srcs{end+1} = "src/disk_available.cpp";
273+
srcs{end+1} = "src/disk_capacity.cpp";
274274
end
275275

276276
if (isMATLABReleaseOlderThan("R2024b") && ~stdlib.has_dotnet()) || build_all

0 commit comments

Comments
 (0)