Boost logo

Boost Users :

From: Tim MacKinnon (tmackinn_at_[hidden])
Date: 2006-05-03 16:19:37


OS - Solaris8
Compiler - gcc 3.4.0
boost version - 1_32

I have an application that is using the boost filesystem library. Here
is a snippit of the code :

void DirectoryInterface::listSubDirectories(String dirPath, FileList & dirList)
{
   pthread_rwlock_rdlock(&DirectoryInterface::fsRwMutex);

   try
   {
      boost::filesystem::path filePath(dirPath, boost::filesystem::native);
      boost::filesystem::directory_iterator iter(filePath), iterEnd;

      if(boost::filesystem::exists(filePath))
      {
         for (; iter != iterEnd; ++iter)
         {
            
            if(boost::filesystem::is_directory(*iter))
            {
               .. do something
            }
         }
      }
   }
   catch (boost::filesystem::filesystem_error& ex)
   {
      .. do something
   }
   catch (std::exception& ex)
   {
      .. do something
   }
   catch (...)
   {
      .. do something
   }

   pthread_rwlock_unlock(&DirectoryInterface::fsRwMutex);
}

An exception is thrown by the call to boost::filesystem::is_directory()
but is not caught by any of the catch blocks shown here. The application
simply terminates with the following message :

terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
  what(): boost::filesystem::is_directory: "/opt/users/tmackinn/neDatabases/20060429050000.auto/10.1.26.25": No such file or directory
Abort - core dumped

Any ideas what I could be doing wrong?

Thanks in advance,
Tim



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net