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

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -