Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
|
---|
2 |
function files=wilddir(datadir,string); |
---|
3 |
|
---|
4 |
% |
---|
5 |
% WILDDIR.M - creates a list of files padded with trailing blanks |
---|
6 |
% (remove with deblank.m or blank.m) of all files in directory DATADIR |
---|
7 |
% ending with STRING |
---|
8 |
% |
---|
9 |
% Catherine R. Edwards |
---|
10 |
% Last modified: 2 Aug 2000 |
---|
11 |
% |
---|
12 |
|
---|
13 |
if nargin==1 |
---|
14 |
string=datadir; |
---|
15 |
datadir=pwd; |
---|
16 |
end |
---|
17 |
|
---|
18 |
D=dir(datadir); N=length(D)-2; |
---|
19 |
|
---|
20 |
files=[]; |
---|
21 |
for i=1:N |
---|
22 |
file=getfield(D(i+2,1),'name'); |
---|
23 |
l=length(file); lstr=length(string); |
---|
24 |
if(l>=lstr) |
---|
25 |
if(strcmp(file(l-lstr+1:l),string)) |
---|
26 |
files=strvcat(files,file); |
---|
27 |
end |
---|
28 |
end |
---|
29 |
end |
---|