https://bugs.llvm.org/show_bug.cgi?id=38837
Bug ID: 38837
Summary: doesn't work
std::filesystem::directory_options::follow_directory_s
ymlink
Product: libc++
Version: 7.0
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
#include <iostream>
#include <filesystem>
#include <fstream>
namespace fs = std::filesystem;
int main()
{
fs::create_directory("dir_a");
std::ofstream{"dir_a/a.txt"};
fs::create_directory("dir_b");
std::ofstream{"dir_b/b.txt"};
fs::create_directory_symlink("dir_a", "dir_b/dir_a");
for (const fs::directory_entry& x : fs::recursive_directory_iterator(
"dir_b",
fs::directory_options::follow_directory_symlink)) {
std::cout << x.path() << std::endl;
}
}
expected result:
"dir_b/b.txt"
"dir_b/dir_a"
"dir_b/dir_a/a.txt"
actual result:
"dir_b/b.txt"
"dir_b/dir_a"
terminating with uncaught exception of type
std::__1::__fs::filesystem::filesystem_error: filesystem error: in
recursive_directory_iterator::operator++(): attempting recursion into
"dir_b/dir_a": Too many levels of symbolic links
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs