33 "Invalid file name supplied " << name <<
34 "the following characters are not allowd: " <<
47 isDir_ = file.empty();
58 catch (std::filesystem::filesystem_error & ec)
61 "Invalid fileSystem input:" <<
91 return fileSystem(path_.parent_path().c_str());
103 return word( path_.filename());
105 catch (std::filesystem::filesystem_error & ec)
122 if( abPath = std::filesystem::absolute( path_, ec); ec )
125 "The absolute path of "<< path_.c_str() <<
" is invalid: "<<
145 if( cnPath = std::filesystem::canonical( path_, ec); ec )
148 "The canonical path of "<< path_.c_str() <<
" cannot be obtained: "<<
168 "This function only operates on dir path, the path is "<<
184 return std::filesystem::exists(path_);
186 catch (std::filesystem::filesystem_error & ec)
202 "This function only operates on dir path, the path is "<<
209 std::filesystem::create_directories(path_);
212 catch (std::filesystem::filesystem_error & ec)
235 checkFileName(fileName);
244 path_ = path_.parent_path()/fileName;
249 void pFlow::fileSystem::operator /=
257 "This operator should be used on dir path only"<<
endl;
261 path_/= fs.dirPath().path_;
289 os << fs.
path_.c_str();
295 os << fs.
path_.c_str();
304 return std::filesystem::is_directory(path.
path());
309 return std::filesystem::is_regular_file(path.
path());
321 auto dOps = std::filesystem::directory_options::skip_permission_denied;
322 for(
auto& subPath: std::filesystem::directory_iterator(path.
path(), dOps) )
326 dirs.emplace_back(subPath.path());
343 auto dOps = std::filesystem::directory_options::skip_permission_denied;
344 for(
auto& subPath: std::filesystem::directory_iterator(path.
path(), dOps) )
346 if( std::filesystem::is_regular_file(subPath.path()) )
348 files.emplace_back(subPath.path());