Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Sofa/framework/Helper/src/sofa/helper/system/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,28 @@ bool FileSystem::createDirectory(const std::string& path)
struct stat st_buf;
if (stat(path.c_str(), &st_buf) == 0)
{
if ((st_buf.st_mode & S_IFMT) != S_IFDIR) {
msg_error(error) << path << ": File exists and is not a directoy";
if ((st_buf.st_mode & S_IFMT) != S_IFDIR)
{
msg_error(error) << path << ": File exists and is not a directory";
return true;
}
else
{
// 'path' was already created and is a folder
return false;
}
}

else
{
msg_error(error) << path << ": Unknown error while trying to create this directory.";
return true;
}
}
}
#endif
else
{
// 'path' has been created sucessfully
return false;
}
}
Expand Down