[filesystem] get relative path from recursive_directory_iterator
Hello! I'm using boost::filesystem v3. Currently recursive_directory_iterator returns absolute path. So the program for (fs::recursive_directory_iterator it("/home/ivan"); it != fs::recursive_directory_iterator(); ++it) std::cout << *it << std::endl; may output /home/ivan/somedir/1.txt /home/ivan/somedir/2.txt But what I want is something like: ./somedir/1.txt ./somedir/2.txt I use function naive_uncomplete described in https://svn.boost.org/trac/boost/ticket/1976 fs::path base = "/home/ivan"; for (fs::recursive_directory_iterator it(base); it != fs::recursive_directory_iterator(); ++it) std::cout << naive_uncomplete(*it, base) << std::endl; Is there any plans to include this function is boost? Is there any possibility to get relative paths using only functions from boost?
participants (1)
-
Ivan Sorokin