checkpoint

This commit is contained in:
Antonio SJ Musumeci 2022-05-16 23:54:48 -04:00
parent 202f29286b
commit c8e8865495
19 changed files with 76 additions and 80 deletions

View file

@ -16,35 +16,30 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "fuse_truncate_func_all.hpp"
#include "fuse_truncate_policy_all.hpp"
#include "fuse_truncate_err.hpp"
#include "fs_truncate.hpp"
namespace gfs = ghc::filesystem;
FUSE::TRUNCATE::FuncALL::FuncALL(const toml::value &toml_)
FUSE::TRUNCATE::POLICY::ALL::ALL(const toml::value &toml_)
: _branches(toml_)
{
}
int
FUSE::TRUNCATE::FuncALL::operator()(const char *fusepath_,
const off_t length_)
FUSE::TRUNCATE::POLICY::ALL::operator()(const gfs::path &fusepath_,
const off_t length_)
{
Err rv;
gfs::path fusepath;
gfs::path fullpath;
fusepath = &fusepath_[1];
for(const auto &branch_group : _branches)
{
for(const auto &branch : branch_group)
{
fullpath = branch.path / fusepath;
fullpath = branch.path / fusepath_;
rv = fs::truncate(fullpath,length_);
}