Overview
Features
Download
Documentation
Community
Add-Ons & Services

Bug in RecursiveDirectoryIterator

A general discussion forum.

Bug in RecursiveDirectoryIterator

Postby gurami1 » 08 Jul 2013, 22:46

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:
Code: Select all
   
        //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::stack<Poco::DirectoryIterator,std::deque<Poco::DirectoryIterator,std::allocator<Poco::DirectoryIterator> > > * itStack, bool * isFinished) Line 133 C++
FoundationUT.exe!Poco::RecursiveDirectoryIteratorImpl<Poco::SiblingsFirstTraverse>::next() Line 107 C++
FoundationUT.exe!Poco::RecursiveDirectoryIterator<Poco::SiblingsFirstTraverse>::operator++() Line 208 C++

Poco::DirectoryIterator class works because implementation of ++ () operator doesn’t call IsDirectory().
gurami1
 
Posts: 1
Joined: 08 Jul 2013, 22:19

Re: Bug in RecursiveDirectoryIterator

Postby alex » 17 Jul 2013, 14:52

Filed bug on GitHub.
alex
 
Posts: 1146
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests