Add basic filesystem structure on linux

This commit is contained in:
oupson 2022-05-31 22:56:36 +02:00
parent d319b0641e
commit f8dba77275
Signed by: oupson
GPG Key ID: 3BD88615552EFCB7
3 changed files with 35 additions and 0 deletions

View File

@ -6,3 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
fuser = "0.11"
log = "0.4"
rustcryptfs-lib = { path = "../rustcryptfs-lib" }
thiserror = "1.0"

View File

@ -0,0 +1,28 @@
use std::path::Path;
use fuser::Filesystem;
use rustcryptfs_lib::config::CryptConf;
pub struct EncryptedFs {}
impl EncryptedFs {
pub fn new<P>(path: P) -> Self
where
P: AsRef<Path>,
{
todo!()
}
pub fn new_from_config(config: &CryptConf) -> Self {
Self {}
}
pub fn mount<P>(self, mountpoint: P)
where
P: AsRef<Path>,
{
fuser::mount2(self, mountpoint, &[]).unwrap();
}
}
impl Filesystem for EncryptedFs {}

View File

@ -0,0 +1,3 @@
mod encrypted_filesystem;
pub use encrypted_filesystem::EncryptedFs;