No BSD License  

Highlights from
Recursive DIR

5.0

5.0 | 3 ratings Rate this file 18 Downloads (last 30 days) File Size: 6.92 KB File ID: #15505

Recursive DIR

by Luc Masset

 

05 Jul 2007 (Updated 02 Oct 2007)

DIRREC finds files recursively in a given folder

| Watch this File

File Information
Description

Find files recursively in a given folder.
 
      C=dirrec('c:\windows') returns a cell C with the full pathname of all
       files in the c:\windows folder and all its sub-folders.
 
      C=dirrec('c:\windows','.exe') idem but returns only the files with
       extension .exe.

      C=dirrec('c:\windows','co*') idem but returns only the files starting with the two letters co (comsetup.log, control.ini, ...).
 
      C=dirrec('c:\windows',{'.exe','.dll') idem but returns files with both
       .exe and .dll extensions.
 
      dirrec('c:\windows','.cmd') only displays the list of the .cmd files in
       the Matlab command window
 
            c:\windows\system32\login.cmd
            c:\windows\system32\usrlogon.cmd
 
      Note that extension should be given in lower case.
 
I was using the DDIR function by Maximilien Chaumon but it was not possible to compile ddir so I write my own function.

Luc

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
12 Jul 2007 s b

Great!!!!

24 Jul 2007 David Chandler

Very useful.

11 Sep 2007 Bob Hamans

Have a look at http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=16217&objectType=file for more extensive search patterns not only by extension.

16 Jul 2010 David

fantastic. great work.

Please login to add a comment or rating.
Updates
02 Oct 2007

Add the possibility to search filenames with starting with given letters. For example, dirrec('c:\windows','co*').

Tag Activity for this File
Tag Applied By Date/Time
path Luc Masset 22 Oct 2008 09:18:20
directories Luc Masset 22 Oct 2008 09:18:20
files Luc Masset 22 Oct 2008 09:18:20
dir Luc Masset 22 Oct 2008 09:18:20
folder Luc Masset 22 Oct 2008 09:18:20
recursive Luc Masset 22 Oct 2008 09:18:20
extension Luc Masset 22 Oct 2008 09:18:20

Contact us at files@mathworks.com