0001 function test_dir_read(outputdir,filetype,logfile)
0002
0003 suppress_if_zero=1;
0004
0005 dl1 = dir(['reduc/',outputdir]);
0006 dl2 = dir(['reduc/',outputdir,'/',dl1(3).name]);
0007
0008 for i = 3:length(dl2)
0009 the_name = dl2(i).name;
0010
0011 dir_search = ['reduc/',outputdir,'/',dl1(3).name,'/',the_name];
0012
0013 [status, result] = unix(['find ',dir_search,' -name "*.',filetype,'"']);
0014
0015
0016 no_found = length(strfind(result, ['.' , filetype]));
0017
0018 if(suppress_if_zero)
0019 if(~(no_found==0))
0020 outstring = ['In directory ',the_name,' found ',int2str(no_found), ' ',filetype,' files'];
0021 disp(outstring);
0022 fprintf(logfile,'%s\n',outstring);
0023 end;
0024 else
0025 outstring = ['In directory ',the_name,' found ',int2str(no_found), ' ',filetype,' files'];
0026 disp(outstring);
0027 fprintf(logfile,'%s\n',outstring);
0028
0029 end;
0030
0031 end;