Skip to content

Commit

Permalink
C++17 example for directory iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-wallis committed Oct 22, 2019
1 parent 02c62f7 commit 95d865d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions dup-finder/dir-iter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Using this as a test for compiling C++17
#include <fstream>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;

int main()
{
fs::create_directories("sandbox/a/b");
std::ofstream("sandbox/file1.txt");
fs::create_symlink("a", "sandbox/syma");
for(auto& p: fs::recursive_directory_iterator("sandbox"))
std::cout << p.path() << '\n';
fs::remove_all("sandbox");
}

0 comments on commit 95d865d

Please sign in to comment.