file - Is there a function in C++ to determine if a specific certain folder in a given directory exists or not? -
is there simple such function in c++? appreciated.
you can use boost's filesystem library. example:
#include <iostream> #include <boost/filesystem.hpp> int main(int argc, char* argv[]) { boost::filesystem::path p("/path/to/directory"); if (exists(p)) { std::cout << p << " exists!" << std::endl; } return 0; }
note boost filesystem not header-only , requires library linking.
Comments
Post a Comment