Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
- struct stat fs;
- assert( dirName[dirName.size()-1] != '/' );
- if(stat(dirName.c_str(), &fs) == 0)
- {
+ struct stat fs;
+ assert( dirName[dirName.size()-1] != '/' );
+ if ( stat(dirName.c_str(), &fs) == 0 )
+ {
HANDLE hFile = FindFirstFile((dirName+"*").c_str(), &fileData);
for(BOOL b = (hFile != INVALID_HANDLE_VALUE); b;
b = FindNextFile(hFile, &fileData))
{
fileName = fileData.cFileName;
HANDLE hFile = FindFirstFile((dirName+"*").c_str(), &fileData);
for(BOOL b = (hFile != INVALID_HANDLE_VALUE); b;
b = FindNextFile(hFile, &fileData))
{
fileName = fileData.cFileName;
- stat(fileName.c_str(), &buf); //really discard output ?
- if( S_ISREG(buf.st_mode) ) //is it a regular file?
+ if( stat(fileName.c_str(), &buf) != 0 )
+ {
+ const char *str = strerror(errno);
+ gdcmErrorMacro( str );
+ }
+ if ( S_ISREG(buf.st_mode) ) //is it a regular file?
{
std::copy(Filenames.begin(), Filenames.end(),
std::ostream_iterator<std::string>(os, "\n"));
{
std::copy(Filenames.begin(), Filenames.end(),
std::ostream_iterator<std::string>(os, "\n"));