Recursive directory walk with -exec (UNIX type)

버전 1.2.0.0 (2.25 KB) 작성자: Ashish Uthama
Directory walking with input function handle called with each matching file found.
다운로드 수: 1.5K
업데이트 날짜: 2010/5/10

라이선스 보기

See decription of RDIR (linked in Acknowledgements) for wildcard use.

Calls a function handle for each matching file found.

rdirExec(ROOT,EXECFUN,OPTEXECFUNARGS)

Recursive directory walk. EXECFUN is a function handle that gets called for each matching file found.The first input argument being the full path of the file, followed by the optional OPTEXECFUNARGS

ROOT is the directory starting point and includes the wildcard specification. Pathnames and wildcards may be used. Wild cards can exist in the pathname too. A special case is the double * that will match multiple directory levels, e.g. c:\**\*.m. Otherwise a single * will only match one directory level.
e.g. C:\Program Files\Windows *\

EXECFUN is a function handle which takes at least one input argument

OPTEXECFUNARGS are optional input arguments to EXECFUN

Examples:

% To create a file list
fid=fopen('fileList.txt','wt');
rdirExec('c:\program files\windows *\**\*.dll',@callBack,fid)
fclose(fid);

%The callBack function has the following signature
function callBack(varargin)
fileName=varargin{1};
fid=varargin{2};
fprintf(fid,'%s\n',fileName);
end

인용 양식

Ashish Uthama (2024). Recursive directory walk with -exec (UNIX type) (https://www.mathworks.com/matlabcentral/fileexchange/22544-recursive-directory-walk-with-exec-unix-type), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Search Path에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

*Fixed 'clear D' bug

1.1.0.0

text indents in desc

1.0.0.0