return_master_list - return a list which contains all directories and files names of a specified directory
tt_ml = return_master_list(path)
- path : string. the directory to analyse.
- tt_ml : a master list.
- tt_ml() : the level in the directory tree
- tt_ml()() : the id of the directory
- tt_ml()()() :
- tt_ml()()(1) : name of the directory
- tt_ml()()(2) : list of files
- tt_ml()()(3) : list of directories
//return_master list
//fonction qui examine l'intégralité d'un répertoire
//et qui retourne ses noms de repertoires et fichiers
//dans une liste scilab.
//Entrée : path un vecteur de noms de répertoire à éxaminer
// de pref en chemin absolu et de taille 1x1
//Sortie tt_ml : liste principale
// tt_ml()()()
// | | |
// | | |
// | | |--> 1 : nom du répertoire
// | | 2 : liste des fichiers
// | | 3 : liste des répertoires sous-adjacents
// | |
// | |--> indice du n° répertoire
// |
// |--> indice du niveau d'arborescence
function tt_ml=return_master_list(path)
if argn(2)==0 | ~exists('path') then
path=MODNUM
elseif typeof(path)<>"string" then
path=MODNUM
elseif path=="" then
path=MODNUM
end
printf("Search directories and files in %s... ",path);
tt_ml=list();k=0;
while path<>[]
k=k+1;
[tt,path]=return_single_list(path);
tt_ml(k)=tt;
end
printf("Done\n");
endfunction
IRCOM Group
Alan Layec