|
@@ -182,7 +182,7 @@ time_t ls::std::io::File::lastModified()
|
|
|
|
|
|
void ls::std::io::File::makeDirectory()
|
|
|
{
|
|
|
- if (ls::std::io::File::_mkdir(this->absoluteFilePath))
|
|
|
+ if (!ls::std::io::File::_mkdir(this->absoluteFilePath))
|
|
|
{
|
|
|
throw ls::std::core::FileOperationException{};
|
|
|
}
|
|
@@ -198,9 +198,12 @@ void ls::std::io::File::makeDirectories()
|
|
|
{
|
|
|
currentHierarchy += subDirectory;
|
|
|
|
|
|
- if (!ls::std::io::File::_exists(currentHierarchy))
|
|
|
+ if (!ls::std::io::File::_exists(currentHierarchy) && !currentHierarchy.empty())
|
|
|
{
|
|
|
- ls::std::io::File::_mkdir(currentHierarchy); // TODO: think of return type usage, maybe change to bool?
|
|
|
+ if (!ls::std::io::File::_mkdir(currentHierarchy))
|
|
|
+ {
|
|
|
+ throw ls::std::core::FileOperationException{}; // TODO: add missing test
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
currentHierarchy += separator;
|
|
@@ -564,7 +567,7 @@ time_t ls::std::io::File::_lastModified(const ::std::string &_path)
|
|
|
|
|
|
#endif
|
|
|
|
|
|
-int ls::std::io::File::_mkdir(const ::std::string &_path)
|
|
|
+bool ls::std::io::File::_mkdir(const ::std::string &_path)
|
|
|
{
|
|
|
int result;
|
|
|
|
|
@@ -576,7 +579,7 @@ int ls::std::io::File::_mkdir(const ::std::string &_path)
|
|
|
result = mkdir(_path.c_str(), 0777);
|
|
|
#endif
|
|
|
|
|
|
- return result;
|
|
|
+ return result == 0;
|
|
|
}
|
|
|
|
|
|
::std::string ls::std::io::File::_normalizePath(::std::string _path)
|