Skip to content

Commit 797c12a

Browse files
committed
Java 1.8 benefits from absolute path
1 parent 2e54328 commit 797c12a

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

+stdlib/+java/device.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
function i = device(file)
22

33
opt = java.nio.file.LinkOption.values();
4-
p = javaPathObject(file);
5-
i = java.nio.file.Files.getAttribute(p, 'unix:dev', opt);
4+
5+
jp = javaPathObject(stdlib.absolute(file));
6+
% Java 1.8 benefits from the absolute() for stability
7+
% seen on older Matlab versions on HPC
8+
9+
i = java.nio.file.Files.getAttribute(jp, 'unix:dev', opt);
610

711
i = uint64(i);
812
end

+stdlib/+java/get_owner.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
n = "";
1717
if ~strlength(file), return, end
1818

19+
file = stdlib.absolute(file);
20+
% Java 1.8 benefits from absolute.
21+
% We only saw this issue with R2025a on windows-2025 GA runner image.
22+
1923
try %#ok<TRYNC>
2024
opt = java.nio.file.LinkOption.values();
2125
n = string(java.nio.file.Files.getOwner(javaPathObject(file), opt));

+stdlib/+java/inode.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
function i = inode(p)
1+
function i = inode(file)
22

33
opt = java.nio.file.LinkOption.values();
44

5-
jp = javaPathObject(stdlib.absolute(p));
5+
jp = javaPathObject(stdlib.absolute(file));
66
% Java 1.8 benefits from the absolute() for stability--it's not an issue
77
% on every computer.
88

0 commit comments

Comments
 (0)