]> Creatis software - crea.git/blobdiff - src/creaFilesFromDirectory.cxx
*** empty log message ***
[crea.git] / src / creaFilesFromDirectory.cxx
index 06c5e6f024895bb148c9b694845cae3eee698cb8..c2245113f0a3bde6e4f1a8de1b1ae0de1848b5fd 100644 (file)
@@ -3,8 +3,8 @@
   Program:   crea
   Module:    $RCSfile: creaFilesFromDirectory.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/03 14:53:42 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2009/04/14 12:54:38 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -53,6 +53,7 @@ std::string DirList::NormalizePath(std::string const &pathname)
    const char FILESEPARATOR = '/';
 #endif
 
+       
    std::string name = pathname;
    int size = name.size();
 
@@ -134,6 +135,7 @@ int DirList::Explore(std::string const &dirpath, bool recursive)
    dirent *d;
    for (d = readdir(dir); d; d = readdir(dir))
    {
+          
       fileName = dirName + d->d_name;
       if( stat(fileName.c_str(), &buf) != 0 )
       {
@@ -141,8 +143,12 @@ int DirList::Explore(std::string const &dirpath, bool recursive)
       }
       if ( S_ISREG(buf.st_mode) )    //is it a regular file?
       {
-         Filenames.push_back( fileName );
-         numberOfFiles++;
+                 //printf("EED DirList::Explore [%s]\n" , d->d_name );
+                 if ( d->d_name[0]!='.')
+                 {     
+                Filenames.push_back( fileName );
+                numberOfFiles++;
+                 }
       }
       else if ( S_ISDIR(buf.st_mode) ) //directory?
       {