#include#include int main() { std::filesystem::path path("/usr/local/bin"); if (std::filesystem::is_directory(path)) std::cout << path << " is a directory\n"; else std::cout << path << " is not a directory\n"; return 0; }
#includeIn this example, we are checking if the path "/usr/local/bin/bash" is a directory or not using the is_directory function from the#include int main() { std::filesystem::path path("/usr/local/bin/bash"); if (std::filesystem::is_directory(path)) std::cout << path << " is a directory\n"; else std::cout << path << " is not a directory\n"; return 0; }