Skip to content
Snippets Groups Projects
Commit 52f227c4 authored by Alderico Gallo's avatar Alderico Gallo
Browse files

Find only list regular files

parent de90ea04
No related branches found
No related tags found
No related merge requests found
Pipeline #305 passed
......@@ -84,13 +84,13 @@ int print_dir_recursive(char *arguments[], bool recursive)
for (std::filesystem::recursive_directory_iterator i(path), end; i != end; ++i)
if (is_directory(i->path()))
std::cout << i->path().generic_string() << "/\n";
else
else if (is_regular_file(i->path()))
std::cout << i->path().generic_string() << "\n";
} else {
for (std::filesystem::directory_iterator i(path), end; i != end; ++i)
if (is_directory(i->path()))
std::cout << i->path().generic_string() << "/\n";
else
else if (is_regular_file(i->path()))
std::cout << i->path().generic_string() << "\n";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment