Skip to content

Commit

Permalink
doc java
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jul 29, 2024
1 parent 947303e commit 11fe893
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions +stdlib/is_absolute.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
function isabs = is_absolute(p)
%% IS_ABSOLUTE
% is path absolute?
%
% https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/io/File.html#isAbsolute()
arguments
p (1,1) string
end

isabs = java.io.File(p).toPath().isAbsolute();

% alternative
% https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/File.html#isAbsolute()
end
5 changes: 3 additions & 2 deletions +stdlib/is_writable.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function ok = is_writable(file)
%% is_writable is file writable
% https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/Files.html#isWritable(java.nio.file.Path)
%% is_writable
% is path writable
% https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/nio/file/Files.html#isWritable(java.nio.file.Path)

arguments
file (1,1) string
Expand Down
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ The "matlab-stdlib" package uses Java functions throughout, with the higher-leve
and the classic
[java.io.File](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/io/File.html) classes.

That is, if Matlab was started with
[-nojvm](https://www.mathworks.com/help/matlab/matlab_env/commonly-used-startup-options.html),
many of the stdlib filesystem function do not work.

## Acknowledgements

Stdlib for Matlab was partly funded by NASA NNH19ZDA001N-HDEE grant 80NSSC20K0176.

0 comments on commit 11fe893

Please sign in to comment.