File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 11%% DISK_AVAILABLE disk available space (bytes)
2- % requires : mex or java
2+ % optional : mex
33%
44% example: stdlib.disk_available('/')
55%
1010 d {mustBeTextScalar }
1111end
1212
13- f = javaFileObject(d ).getUsableSpace();
14-
15- f = uint64(f );
16-
13+ if ispc()
14+ % 4x faster than Java
15+ f = System .IO .DriveInfo(d ).AvailableFreeSpace();
16+ else
17+ f = javaFileObject(d ).getUsableSpace();
18+ f = uint64(f );
1719end
1820
1921% !assert (disk_available('.') > 0)
Original file line number Diff line number Diff line change 11%% DISK_CAPACITY disk total capacity (bytes)
2- % requires : mex or java
2+ % optional : mex
33%
44% example: stdlib.disk_capacity('/')
55
88 d {mustBeTextScalar }
99end
1010
11- f = javaFileObject(d ).getTotalSpace();
12-
13- f = uint64(f );
11+ if ispc()
12+ % 4x faster than Java
13+ f = System .IO .DriveInfo(d ).TotalSize();
14+ else
15+ f = javaFileObject(d ).getTotalSpace();
16+ f = uint64(f );
17+ end
1418
1519end
1620
You can’t perform that action at this time.
0 commit comments