branch2.cpp

This commit is contained in:
Antonio SJ Musumeci 2024-01-31 21:38:11 -06:00
parent d27ef7bc51
commit 1b57f55403
2 changed files with 10 additions and 0 deletions

View file

@ -97,6 +97,7 @@ enabled = true
name = 'branch1'
type = 'literal'
path = '/mnt/branch1'
mode = 'RW'
[[branches.tier.branch]]
active = true
path = '/mnt/disk*'
@ -107,6 +108,8 @@ if-not-mountpoint = 'fail' # 'fail' | 'deactivate' ?
# TIER 1
[[branches.tier]]
[[branches.tier.branch]]
enabled = true
name = 'branch0'
type = 'literal'
path = 'foo'
mode = 'RO'

View file

@ -2,6 +2,10 @@
#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
Branch2::Branch2()
: mode(Mode::RW)
@ -18,4 +22,7 @@ Branch2::Branch2(toml::value const &v_)
mode = Mode::_from_string(toml::find<std::string>(v_,"mode").c_str());
min_free_space = 0;
path = toml::find<std::string>(v_,"path");
int const flags = O_DIRECTORY | O_PATH;
fd = openat(AT_FDCWD,path.string().c_str(),O_DI
}