Recursive directory listing - Enhanced RDIR

Files and directories listing, including recursive and other special features
ダウンロード: 7.1K
更新 2014/1/27

ライセンスの表示

Enhanced version of RDIR function, fixing some bugs and adding some features.

- Basic use is similar to Matlab "dir" function, which allow you to list files and directories in a given path :

rdir([matlabroot, '\*.txt'])

When asked, rdir output structure is the same as dir output structure :

d = rdir([matlabroot, '\*.txt'])

- As initial RDIR function, you can use a double wildcard (**) to list files in all subdirectories from a given path :

rdir([matlabroot, '\**\*tmpl*.m'])

- And also use a filter entered as 2nd argument to refine your search :

rdir([matlabroot, '\**\*tmpl*.m'], 'bytes>0')

This enhanced version of RDIR allow you to define filter on all fields of returned structure and also to use functions like "regexp" or "strfind" on "name" field. You can also use a function handle working on dir-like structure to refine the search.

- You can then add as 3rd argument a path to remove from beginning of "name" field of each listed item :

rdir([matlabroot, '\*.txt'], '', 'C:\Program Files\')
All in : C:\Program Files\
76 kb 02-Aug-2007 16:03:52 MATLAB\R2007b\license.txt
631 b 02-Aug-2007 15:18:42 MATLAB\R2007b\patents.txt
413 b 04-Aug-2007 12:16:36 MATLAB\R2007b\trademarks.txt

- ".svn" directories created by SubVersion (SVN) are excluded from the recursive listing.

See published examples for more details on how to use all RDIR capabilities.

引用

Thomas Vanaret (2024). Recursive directory listing - Enhanced RDIR (https://www.mathworks.com/matlabcentral/fileexchange/32226-recursive-directory-listing-enhanced-rdir), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2007b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersFile Operations についてさらに検索
謝辞

ヒントを得たファイル: Recursive directory listing

ヒントを与えたファイル: rdir_dos, youemel, Dicom Operator - EsmeProcess, orphan_libs(test, trgt)

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.5.0.0

Examples script update only

1.4.0.0

Version 2.3 :
Adding improvements suggested by X. Mo :
- function handle as TEST input
- code optimisation (avoiding loop)
Fixing possible bug when using a wildcard at the beginning;
Common path as 2nd optionnal output;

1.3.0.0

Version 2.2
Fixing bug on display with 0b files;
Specific display when no file match filter;

1.1.0.0

Licence update

1.0.0.0