C++ Filesystem

Da Andreabont's Wiki.
#include <iostream>
#include <fstream>
#include <cstdint>
#include <filesystem>
 
int main() {
    
    if(!std::filesystem::exists("sandbox")) {
        
        std::filesystem::create_directory("sandbox");
        std::ofstream("sandbox/file");
        std::filesystem::create_symlink("file", "sandbox/symlink");
        
    }

    for(const auto& entry : std::filesystem::directory_iterator("sandbox")) {
        std::cout << entry.path() << " (" << entry.file_size() << ")" << std::endl;
    }

    std::filesystem::remove_all("sandbox");
   
}