Create folder in Unix - C++ File Stream

C++ examples for File Stream:Directory

Description

Create folder in Unix

#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <cstring>
#include <errno.h>
#include <cstdlib>

using namespace std;

int main(int argc, char** argv) {

   if (mkdir("newFolderUnix", 0777) == -1) {  // Create the directory
      cerr << "Error: " << strerror(errno);
      return(EXIT_FAILURE);
   }

}

Related Tutorials