X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreaFilesFromDirectory.cxx;h=c2245113f0a3bde6e4f1a8de1b1ae0de1848b5fd;hb=024e27a190403e747501f3dafcc6600683b39937;hp=2d9f21550d28cf2a6bedae70ebf08fe287e62f42;hpb=ba499d06876469f701625fd801256652b3f591d9;p=crea.git diff --git a/src/creaFilesFromDirectory.cxx b/src/creaFilesFromDirectory.cxx index 2d9f215..c224511 100644 --- a/src/creaFilesFromDirectory.cxx +++ b/src/creaFilesFromDirectory.cxx @@ -3,8 +3,8 @@ Program: crea Module: $RCSfile: creaFilesFromDirectory.cxx,v $ Language: C++ - Date: $Date: 2008/11/25 13:15:57 $ - Version: $Revision: 1.1 $ + 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 @@ -34,6 +34,7 @@ #include //stat function #include "creaFilesFromDirectory.h" + #include "creaMessageManager.h" namespace crea { @@ -47,11 +48,12 @@ std::string DirList::NormalizePath(std::string const &pathname) #ifdef _WIN32 - const char FILESEPARATOR = '\\; + const char FILESEPARATOR = '\\'; #else const char FILESEPARATOR = '/'; #endif + std::string name = pathname; int size = name.size(); @@ -109,7 +111,7 @@ int DirList::Explore(std::string const &dirpath, bool recursive) MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf,0,NULL); - gdcmErrorMacro("FindNextFile error. Error is " << (char *)lpMsgBuf + creaError("FindNextFile error. Error is " << (char *)lpMsgBuf <<" for the directory : "<d_name; if( stat(fileName.c_str(), &buf) != 0 ) { @@ -140,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? {