Documentation of findfilesup
Global Index (all files) (short | long)
| Local contents
| Local Index (files in subdir) (short | long)
Function Synopsis
[PathFileList, FileList, PathList] = findfilesup(SearchFileMask, SearchPathMask, SearchLevels, SearchMode)
Help text
Find Files upwards the directory structure regarding a search mask
This function searches for files in the current directory and depending
on the given SearchLevel upwards through directories.
The search file mask can conatin * for searching with wildcards.
The search path mask can also contain * as wildcard. Please
keep in mind, that the search path upwards has only one directory
at each level.
The utility function findfiles is used for the actual search process.
Currently always the full path is returned (absolute path).
Syntax: [PathFileList, FileList, PathList] = findfilesup(SearchFileMask, SearchPathMask, SearchLevel)
Input parameter:
SearchFileMask - String or cell array of strings containing the file mask
to search for {'*.m'; 'ma*'; '*am.mat'}
if omitted or empty '*' is used
if NaN (not a string): search for all directories
SearchPathMask - String containing the path to search on
The path may contain as many masks (*) as necessary
and also on lower levels {'v:\ge*\pl*\fritz'}, the extension
of the * is handled by the function
special strings: '' or '.': current directory
if omitted or empty '.' (current directory) is used
SearchLevel - Scalar indicating how much levels of directorys (beginning with the SearchPath)
should be searched
1: only SearchPath
n: SearchPath + (n-1) levels upwards
if omitted or empty 1 is used
Output parameter:
PathFileList- Cell array of string(s) containing the path and name of the found files
FileList - Cell array of string(s) containing the name of the found files
PathList - Cell array of string(s) containing the path of the found files
Example:
% Search in directory TSeq001 and 3 levels up for files with mask *SystemOption.m
% not recursively
>> [pfl, fl, pl] = findfiles('*SystemOptions.m', 'TSeq001', 4);
pfl =
'c:\projekte\mtest\models\test\st_regler\regelkreis\test001\tseq001\MTest_SystemOptions.m'
'c:\projekte\mtest\models\test\st_regler\regelkreis\MTest_SystemOptions.m'
'c:\projekte\mtest\models\test\st_regler\MTest_SystemOptions.m'
fl =
'MTest_SystemOptions.m'
'MTest_SystemOptions.m'
'MTest_SystemOptions.m'
pl =
'c:\projekte\mtest\models\test\st_regler\regelkreis\test001\tseq001\'
'c:\projekte\mtest\models\test\st_regler\regelkreis\'
'c:\projekte\mtest\models\test\st_regler\'
% Search in directories gea*\gr* and in geaobj for files with mask *an*.m and *objfun1*.mat
% not recursively
>> [pfl, fl, pl] = findfiles({'*am*.m'; '*objfun1*.mat'}, {'gea*\p*', 'geaobj\gr*'});
pfl =
'geatbx\plotext\samdata.m'
'geatbx\plotext\sammon.m'
'geaobj\grafics\res_beasv_objfun1_var_2_01.mat'
'geaobj\grafics\res_beasv_objfun1c_var_2_01.mat'
fl =
'samdata.m'
'sammon.m'
'res_beasv_objfun1_var_2_01.mat'
'res_beasv_objfun1c_var_2_01.mat'
pl =
'geatbx\plotext\'
'geatbx\plotext\'
'geaobj\grafics\'
'geaobj\grafics\'
See also: findfiles, dir
Cross-Reference Information
This document is part of
version 3.8 of the
GEATbx: Genetic and Evolutionary Algorithm Toolbox for use with Matlab -
www.geatbx.com.
The Genetic and Evolutionary Algorithm Toolbox is
not public domain.
© 1994-2006 Hartmut Pohlheim, All Rights Reserved,
(support@geatbx.com).