File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 11%% UNLINK delete file or empty directory
2- % requires : mex
2+ % optional : mex
33%
44% Matlab or GNU Octave delete() has trouble with not being able to delete
5- % open files on Windows, this function overcomes that.
6- % Also, this function returns boolean success status, which factory
5+ % open files on Windows. This MEX function overcomes that limitation .
6+ % This function returns a boolean success status, which
77% delete() does not.
88%
99% %% Inputs
1313%
1414% This function is written in C++ using STL <filesystem>
1515
16- function unlink(~)
17- error(" buildtool mex" )
16+ function ok = unlink(apath )
17+ arguments
18+ apath (1 ,1 ) string
19+ end
20+
21+ %% fallback for if MEX not compiled
22+ try
23+ delete(apath );
24+ ok = true ;
25+ catch
26+ ok = false ;
27+ end
28+
1829end
You can’t perform that action at this time.
0 commit comments