#include <string>
#include <iostream>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
int main()
{
std::string const path = "/home/Work/cpp/";
std::string name;
std::cout << "Input project name: ";
std::cin >> name;
if (name.empty())
{
std::cerr << "Empty file name" << std::endl;
return EXIT_FAILURE;
}
std::string const dir = path + name;
if (mkdir(dir.c_str(), 0755) == -1)
{
perror("Cannot create directory");
return EXIT_FAILURE;
}
std::cerr << dir << " created" << std::endl;
return EXIT_SUCCESS;
}