File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 66% https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/nio/file/Files.html#getOwner(java.nio.file.Path,java.nio.file.LinkOption...)
77% https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/nio/file/LinkOption.html
88
9- owner = string( java .nio .file .Files .getOwner( java . io .File( path ).toPath(), java . nio . file . LinkOption .values )) ;
9+ opt = java .nio .file .LinkOption .values ;
1010
11- end
11+ owner = string(java .nio .file .Files .getOwner(java .io .File(path ).toPath(), opt ));
12+
13+ end
Original file line number Diff line number Diff line change 1+ function c = hard_link_count(filepath )
2+ % HARD_LINK_COUNT get the number of hard links to a file
3+ % https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/Files.html#getPosixFileAttributes(java.nio.file.Path,java.nio.file.LinkOption...)
4+ % https://docs.oracle.com/javase/tutorial/essential/io/links.html
5+ arguments
6+ filepath (1 ,1 ) string {mustBeFile }
7+ end
8+
9+ if ispc
10+ c = [];
11+ return
12+ end
13+
14+ opt = java .nio .file .LinkOption .values ;
15+
16+ c = java .nio .file .Files .getAttribute(java .io .File(filepath ).toPath(), " unix:nlink" , opt );
17+ % Files.getAttribute(filePath, "unix:nlink")
18+
19+ end
You can’t perform that action at this time.
0 commit comments