Log error when mkdir() fails

This commit is contained in:
Allan Odgaard
2013-12-14 14:22:15 +07:00
parent 0a21664f6d
commit 1f57336da8

View File

@@ -837,7 +837,8 @@ namespace path
if(path != NULL_STR && !exists(path))
{
make_dir(parent(path));
mkdir(path.c_str(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH);
if(mkdir(path.c_str(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH) == -1)
perror(text::format("mkdir(“%s”)", path.c_str()).c_str());
}
return exists(path) && info(resolve(path)) & flag::directory;
}