Skip to content

Commit b5eeb49

Browse files
committed
is_char_device: python
1 parent 0011c48 commit b5eeb49

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

+stdlib/is_char_device.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
%% IS_CHAR_DEVICE is path a character device
2-
% requires: mex
32
%
43
% e.g. NUL, /dev/null
54
% false if file does not exist
@@ -9,11 +8,13 @@
98
p {mustBeTextScalar}
109
end
1110

12-
if stdlib.isoctave()
11+
if stdlib.has_python()
12+
ok = py.pathlib.Path(p).is_char_device();
13+
elseif stdlib.isoctave()
1314
[s, err] = stat(p);
1415
ok = err == 0 && S_ISCHR(s.mode);
1516
else
16-
error("buildtool mex")
17+
ok = logical.empty;
1718
end
1819

1920
end

0 commit comments

Comments
 (0)