Scilab Function
eng


return_master_list

File content


//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=MODNUMSCI
 elseif typeof(path)<>"string" then
  path=MODNUMSCI
 elseif path=="" then
  path=MODNUMSCI
 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