Re: [Boost-bugs] [Boost C++ Libraries] #4494: recursive_directory_iterator throws unexpectedly in the non-throw mode

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4494: recursive_directory_iterator throws unexpectedly in the non-throw mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-11-27 20:35:23


#4494: recursive_directory_iterator throws unexpectedly in the non-throw mode
--------------------------------------+-------------------------------------
  Reporter: ttan@… | Owner: bemandawes
      Type: Feature Requests | Status: new
 Milestone: Boost 1.44.0 | Component: filesystem
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords: filesystem v3 throw
--------------------------------------+-------------------------------------

Comment (by zsolt.ero@…):

 After numerous un-answered posts to the boost-users list, finally I found
 out that not I am the first one with this problem. I clearly think it's
 not a feature request, it a bug!

 If you use a directory iterator, you can make a recursive function for it,
 and inside this function you can use try-catch, which will work fine. But
 '''with recursive_directory_iterator there is no way to use it''' for
 example parse a root folder on a Windows PC
 I found the same experience:
 1. you need to provide a exception handling _inside_ the for loop, for
 normal errors, like missing, path not found, etc., which can continue
 within the loop
 2. and one outside, just for the "not accessible" error, which terminates
 the loop
 3. Even if you do a while... loop with an if {it++} at the end, '''there
 is no function which would check''' if the it++ will work or not. All the
 is_something passes fine. It's only when the iterating actually happens,
 that a exception is thrown, which happens outside the for/while loop, thus
 not possible to catch it inside.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4494#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC