Fonction Scilab
fr


return_fil_name

Contenu du fichier


 
function tt=return_fil_name(path)
 tt=[];
 if MSDOS then
   if part(path,length(path))=='\' then
      path=part(path,1:length(path)-1);
   end
 end
 if fileinfo(path)<>[] then
   rep=pwd();
   chdir(path);

   if MSDOS then
     k=1;
     tt=[];
     str='ttf=unix_g(''dir /B'');';
     execstr(str,'errcatch');
     if ttf<>[] then
       for j=1:size(ttf,1)
         if ~isdir(ttf(j)) then 
           tt(k)=ttf(j); k=k+1;
         end
       end
     end

   else
     k=1;
     tt=[];
     str='ttf=unix_g(""ls"")';
     execstr(str,'errcatch');
     if ttf<>[] then
       for j=1:size(ttf,1)
         if ~isdir(ttf(j)) then 
           tt(k)=ttf(j); k=k+1;
         end
       end
     end
   end
 
   chdir(rep);
 end
endfunction