File tree Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Original file line number Diff line number Diff line change 77end
88
99% https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/File.html#getParent()
10- % java was 10x slower and not correct for input like C:
10+ % java was 10x slower and not correct for input like C:/
1111
1212p = stdlib .drop_slash(pth );
1313
Original file line number Diff line number Diff line change 1+ function s = jPosix(o )
2+
3+ d = " " ;
4+
5+ if isempty(o )
6+ s = " " ;
7+ else
8+ s = o .toString();
9+ end
10+
11+ if isa(d , " string" )
12+ s = string(s );
13+ end
14+
15+ s = stdlib .posix(s );
16+
17+ end
Original file line number Diff line number Diff line change 1010end
1111
1212
13- r = " " ;
14- if stdlib .len(p ) == 0
15- return
16- end
17-
18-
1913if stdlib .isoctave()
2014 o = javaObject(" java.io.File" , p ).toPath().getRoot();
21- if ~isempty(o )
22- r = stdlib .posix(o .toString());
23- end
15+ r = jPosix(o );
2416elseif use_java
25- r = stdlib .posix(java .io .File(p ).toPath().getRoot().toString());
17+ o = java .io .File(p ).toPath().getRoot();
18+ r = jPosix(o );
2619else
2720
2821 r = stdlib .root_name(p );
You can’t perform that action at this time.
0 commit comments