File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 33% https://docs.python.org/3/library/os.path.html#os.path.ismount
44
55function y = is_mount(filepath )
6- arguments
7- filepath (1 ,1 ) string
8- end
96
107y = logical .empty ;
11- if ~stdlib .exists(filepath ), return , end
8+
9+ p = py .pathlib .Path(filepath );
10+ if ~p .exists(), return , end
1211
1312% some Python on CI needs this. Didn't replicate on local Windows PC.
14- if ispc() && strcmp(filepath , stdlib .root_name( filepath )) && ~endsWith(filepath , " /" | filesep )
13+ if ispc() && strcmp(filepath , string( p . drive )) && ~endsWith(filepath , " /" | filesep )
1514 y = false ;
1615 return
1716end
1817
1918try % #ok<TRYNC>
20- y = py .os .path .ismount(filepath );
19+ y = py .os .path .ismount(p );
2120end
2221
2322end
Original file line number Diff line number Diff line change 11function r = read_symlink(file )
2- arguments
3- file (1 ,1 ) string
4- end
52
63r = " " ;
74
8- if ~stdlib .is_symlink(file ), return , end
5+ p = py .pathlib .Path(file );
6+ if ~p .is_symlink(), return , end
97
108% https://docs.python.org/3/library/pathlib.html#pathlib.Path.readlink
119try
12- r = string(py .os .readlink(file ));
10+ r = string(py .str( p .readlink() ));
1311 if ispc() && startsWith(r , ' \\ ?\' )
1412 r = extractAfter(r , ' \\ ?\' );
1513 end
You can’t perform that action at this time.
0 commit comments