Thread Subject: Extract all filenames in a directory tree

Subject: Extract all filenames in a directory tree

From: spasmous

Date: 9 Jun, 2008 18:13:58

Message: 1 of 5

Is there a simple way to get all of the filenames in a directory with
paths, including the subdirectories? I'm writing a recursive dir but
it occurred to me someone has probably written a one-liner already.

Subject: Extract all filenames in a directory tree

From: us

Date: 9 Jun, 2008 18:21:02

Message: 2 of 5

spasmous:
<SNIP looking for a recursive file liste(ne)r...

there are quite a few utilities on the FEX, just look for
them...

us

Subject: Extract all filenames in a directory tree

From: spasmous

Date: 9 Jun, 2008 18:55:24

Message: 3 of 5

On Jun 9, 11:21=A0am, "us " <u...@neurol.unizh.ch> wrote:
> spasmous:
> <SNIP looking for a recursive file liste(ne)r...
>
> there are quite a few utilities on the FEX, just look for
> them...
>

Hi us. I saw a couple... meh, ugly. There must be a one line
solution ;)

Subject: Extract all filenames in a directory tree

From: us

Date: 9 Jun, 2008 19:24:01

Message: 4 of 5

spasmous:
<SNIP looking for a one-line recursive folder lister...

> There must be a one line solution...

unfortunately: NO - if you want to stay within ML...
otherwise, this might be of interest

% on a wintel system
     [r,r]=system('dir /S /B *.m');
% followed by
     r=strread(r,'%s');
% -or- (depending on what unix-flavor you have)
     [r,r]=system('ls -Rp */*.m');

us

Subject: Extract all filenames in a directory tree

From: Vihang Patil

Date: 10 Jun, 2008 06:02:08

Message: 5 of 5

spasmous <spasmous@gmail.com> wrote in message
<23f218e1-fb2b-438f-b039-1562c9956c42@s21g2000prm.googlegroups.com>...
> Is there a simple way to get all of the filenames in a
directory with
> paths, including the subdirectories? I'm writing a
recursive dir but
> it occurred to me someone has probably written a one-liner
already.
>


Hello
Try the fuf utility found on the FEX.
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=1378&objectType=file

HTH
Vihang

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
system us 9 Jun, 2008 15:25:09
code us 9 Jun, 2008 15:25:09
strread us 9 Jun, 2008 15:25:09
dir us 9 Jun, 2008 15:25:09
ls us 9 Jun, 2008 15:25:09
file exchange us 9 Jun, 2008 14:25:05
fex us 9 Jun, 2008 14:25:05
reference us 9 Jun, 2008 14:25:05
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com