mirror of https://github.com/trapexit/mergerfs.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
531 B
34 lines
531 B
#include "func_unlink_all.hpp"
|
|
|
|
#include "error.hpp"
|
|
#include "fs_unlink.hpp"
|
|
|
|
|
|
std::string_view
|
|
Func2::UnlinkAll::name() const
|
|
{
|
|
return "all";
|
|
}
|
|
|
|
int
|
|
Func2::UnlinkAll::operator()(const Branches &branches_,
|
|
const fs::path &fusepath_)
|
|
{
|
|
Err err;
|
|
fs::path fullpath;
|
|
|
|
for(const auto &branch : branches_)
|
|
{
|
|
if(branch.ro())
|
|
{
|
|
err = -EROFS;
|
|
continue;
|
|
}
|
|
|
|
fullpath = branch.path / fusepath_;
|
|
|
|
err = fs::unlink(fullpath);
|
|
}
|
|
|
|
return err;
|
|
}
|