Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug in RecursiveDirectoryIterator #236

Closed
aleks-f opened this Issue · 1 comment

2 participants

@aleks-f
Owner

From http://pocoproject.org/forum/viewtopic.php?f=10&t=5928

postby gurami1 » Mon Jul 08, 2013 3:46 pm

Bug in RecursiveDirectoryIterator and SortedDirectoryIterator (the “++ ()” operator throws and there are no way to advance )
Platform: Windows 7 64bit
Poco version : 1.5.2

Here is simple test:

        //Poco::SortedDirectoryIterator dirIterator(p);
   //Poco::SortedDirectoryIterator end;

   //Poco::SimpleRecursiveDirectoryIterator dirIterator(p);
   //Poco::SimpleRecursiveDirectoryIterator end;

   Poco::Path p ("c:\\");
   Poco::SiblingsFirstRecursiveDirectoryIterator  dirIterator(p);
   Poco::SiblingsFirstRecursiveDirectoryIterator end;   

   while (dirIterator != end)
   {
      try
      {
         std::cout << dirIterator->path() <<  std::endl;
         ++dirIterator;
      }
      catch (Poco::FileException &exc)
      {
         std::cout << exc.displayText() <<  std::endl;
                        break;
      }
        }

The “++dirIterator“ throws “File access error: sharing violation: c:\hiberfil.sys” for c:\hiberfil.sys file.
Here is stack:

PocoFoundation64d.dll!Poco::FileImpl::isDirectoryImpl() Line 185 C++
PocoFoundation64d.dll!Poco::File::isDirectory() Line 160 C++
PocoFoundation64d.dll!Poco::SiblingsFirstTraverse::next(std::stackPoco::DirectoryIterator,std::deque<Poco::DirectoryIterator,std::allocator<Poco::DirectoryIterator > > * itStack, bool * isFinished) Line 133 C++
FoundationUT.exe!Poco::RecursiveDirectoryIteratorImplPoco::SiblingsFirstTraverse::next() Line 107 C++
FoundationUT.exe!Poco::RecursiveDirectoryIteratorPoco::SiblingsFirstTraverse::operator++() Line 208 C++

Poco::DirectoryIterator class works because implementation of ++ () operator doesn’t call IsDirectory().

@obiltschnig
Owner

fixed in develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.