help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Directory Listing in Octave -- Recursion


From: HALL, BENJAMIN PW
Subject: RE: Directory Listing in Octave -- Recursion
Date: Wed, 9 Dec 2009 12:12:05 -0500

>-----Original Message-----
>From: Greg_G [mailto:address@hidden 
>Sent: Wednesday, December 09, 2009 11:26 AM
>To: address@hidden
>Subject: Re: Directory Listing in Octave -- Recursion
>
>
>Here is a Windows-specific method of recursion using "system" and the
"dir"
>command:
>
>patdir= (['dir /b /s "',<directory>,'\*.dat"']);
>[status data] = system ( patdir, 1); 
>
>Unfortunately, the string variable "data" is a (1 x N) char array and
has to
>be split into strings based on the end-of-line character "\n".
>
>Is there anything a little cleaner?

Here is something I found in my files...

## Windows versions of octave come packaged with the find utility
## as provided by MSYS.  This is the found in the path before the
## Windows built-in (and worthless) find utility.  So, it turns
## out to be easy...

[stat,lsout] = system( sprintf("find %s -name '*.cmp'",cpath), 1, "sync"
);

fls = cellstr( split( lsout, "\n" ) );




reply via email to

[Prev in Thread] Current Thread [Next in Thread]