Horje
how to find out if a directory exists in cpp Code Example
check if directory exists cpp
#include <sys/stat.h>

bool IsPathExist(const std::string &s)
{
  struct stat buffer;
  return (stat (s.c_str(), &buffer) == 0);
}
how to find out if a directory exists in cpp
#include <sys/stat.h>

int main() {
	struct stat buffer;
    std::string string = "Hello";
    
    if (stat(&string.c_str(), &buffer) != 0) {
    	std::cout << "'Hello' directory doesn't exist!";
    } else {
    	std::cout << "'Hello' directory exists!";
    }
}




Java

Related
runtime exception in java Code Example runtime exception in java Code Example
fibonacci of 6 Code Example fibonacci of 6 Code Example
java use variables inside strings Code Example java use variables inside strings Code Example
Write a method multiply() in a class Arithmetic Code Example Write a method multiply() in a class Arithmetic Code Example
Java String join Code Example Java String join Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7