Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <filesystem>
- #include <iostream>
- #include <string>
- #include <algorithm>
- int main()
- {
- const std::string path = "/proc/";
- for(const auto& entry : std::filesystem::directory_iterator(path))
- {
- if(std::all_of(entry.path().begin(), entry.path().end(), ::isdigit))
- std::cout << entry.path() << '\n';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement