File tree Expand file tree Collapse file tree 5 files changed +15
-14
lines changed Expand file tree Collapse file tree 5 files changed +15
-14
lines changed Original file line number Diff line number Diff line change 22
33function pid = get_pid()
44
5- if stdlib .matlabOlderThan(' R2025a' )
6- pid = feature(' getpid' ); % #ok<FEATGPID>
7- else
5+ try
86 pid = matlabProcessID ;
7+ catch e
8+ switch e .identifier
9+ case ' MATLAB:UndefinedFunction'
10+ pid = feature(' getpid' );
11+ case ' Octave:undefined-function'
12+ pid = getpid();
13+ otherwise
14+ rethrow(e )
15+ end
916end
1017
1118pid = uint64(pid );
Original file line number Diff line number Diff line change 22% does not check if the file is actually a binary executable
33%
44% %% inputs
5- % file: path to check
5+ % * file: path to check
66% %% Outputs
7- % ok: true if path is a file and has executable permissions
8- %
9- % this method is like 40x faster than native.
7+ % * y: true if path is a file and has executable permissions
108
119function y = is_exe(file )
1210
Original file line number Diff line number Diff line change 11%% IS_READABLE is file readable
22%
33% %% Inputs
4- % file: single path string
4+ % * file: single path string
55% %% Outputs
6- % y: true if file is readable
7- %
8- % this method is like 40x faster than native
6+ % * y: true if file is readable
97
108function y = is_readable(file )
119
Original file line number Diff line number Diff line change 44% * file: path to file or folder
55% %% Outputs
66% * y: true if file is writable
7- %
8- % this method is like 40x faster than native
97
108function y = is_writable(file )
119
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ Matlab R2017a and newer:
2323test_main
2424```
2525
26- For the functions compatible with GNU Octave:
26+ For the functions compatible with GNU Octave, from the matlab-stdlib/ directory :
2727
2828``` octave
2929addpath(pwd)
You can’t perform that action at this time.
0 commit comments