Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5652: recursive_directory_iterator fails on cyclic symbolic links
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-17 14:36:45
#5652: recursive_directory_iterator fails on cyclic symbolic links
----------------------------------------------+-----------------------------
Reporter: Geurt Vos <geurt.vos@â¦> | Owner: bemandawes
Type: Bugs | Status: assigned
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.46.1 | Severity: Problem
Resolution: | Keywords:
----------------------------------------------+-----------------------------
Changes (by bemandawes):
* status: new => assigned
Comment:
Replying to [comment:1 Daniel Aarno <macbishop@â¦>]:
> I can confirm this issue and there is an easy fix. To reproduce and test
the issue the following simple program that counts the files (recursively)
in a directory can be used on a directory containing the "symlink to self"
as described by Geurt.
>
> #include <string>
> #include <iostream>
>
> #include <boost/filesystem.hpp>
>
> int
> ftw(const std::string &root) {
> using namespace boost::filesystem;
> typedef recursive_directory_iterator walker;
> int count = 0;
> for (walker w(root); w != walker(); ++w)
> ++count;
>
> return count;
> }
>
> int
> main (int argc, const char **argv) {
> int count = ftw(argv[1]);
> std::cout << count << std::endl;
> }
Thanks for the test program! Providing a test program is a very effective
way to communicative exactly what problem you are having, and prevents me
from chasing my tail around in circles.
On Windows the program throws with a message "The name of the file cannot
be resolved by the system". I haven't looked at your patch yet, but wanted
to thank you for the test case first,
--Beman
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5652#comment:4> 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:08 UTC