Skip to content

Commit a97a659

Browse files
committed
get_permissions: octave stat()
1 parent bbf9f14 commit a97a659

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

+stdlib/get_permissions.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010
p = '';
1111

1212
try
13-
if ~stdlib.exists(f), return, end
1413
v = filePermissions(f);
1514
catch e
1615
if strcmp(e.identifier, "MATLAB:io:filesystem:filePermissions:CannotFindLocation")
1716
return
18-
elseif ~strcmp(e.identifier, "MATLAB:UndefinedFunction") && ...
19-
~strcmp(e.identifier, "Octave:undefined-function")
17+
elseif strcmp(e.identifier, "Octave:undefined-function")
18+
s = stat(f);
19+
if ~isempty(s)
20+
p = s.modestr;
21+
end
22+
return
23+
elseif ~strcmp(e.identifier, "MATLAB:UndefinedFunction")
2024
rethrow(e)
2125
end
2226

0 commit comments

Comments
 (0)