From 1b57f5540305118cf309f95c972d44f3bd54e87e Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Wed, 31 Jan 2024 21:38:11 -0600 Subject: [PATCH] branch2.cpp --- config.toml | 3 +++ src/branch2.cpp | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/config.toml b/config.toml index 7543e160..37c5cef4 100644 --- a/config.toml +++ b/config.toml @@ -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' diff --git a/src/branch2.cpp b/src/branch2.cpp index b91d83c0..95f7d1a6 100644 --- a/src/branch2.cpp +++ b/src/branch2.cpp @@ -2,6 +2,10 @@ #include +#include +#include +#include + Branch2::Branch2() : mode(Mode::RW) @@ -18,4 +22,7 @@ Branch2::Branch2(toml::value const &v_) mode = Mode::_from_string(toml::find(v_,"mode").c_str()); min_free_space = 0; path = toml::find(v_,"path"); + + int const flags = O_DIRECTORY | O_PATH; + fd = openat(AT_FDCWD,path.string().c_str(),O_DI }