diff --git a/.gitignore b/.gitignore index d87d379..077b91f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target *.py enc -mount \ No newline at end of file +mount +.cargo \ No newline at end of file diff --git a/rustcryptfs-fuse/Cargo.toml b/rustcryptfs-fuse/Cargo.toml index 1829686..8d04943 100644 --- a/rustcryptfs-fuse/Cargo.toml +++ b/rustcryptfs-fuse/Cargo.toml @@ -7,8 +7,10 @@ license = "MIT OR Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -fuser = { version = "0.11", default-features = false } log = "0.4" rustcryptfs-lib = { path = "../rustcryptfs-lib" } thiserror = "1.0" -libc = "0.2" \ No newline at end of file +libc = "0.2" + +[target.'cfg(target_os = "linux")'.dependencies] +fuser = { version = "0.11", default-features = false } \ No newline at end of file diff --git a/rustcryptfs-fuse/src/lib.rs b/rustcryptfs-fuse/src/lib.rs index 8e1278d..f86e367 100644 --- a/rustcryptfs-fuse/src/lib.rs +++ b/rustcryptfs-fuse/src/lib.rs @@ -1,6 +1,10 @@ +#[cfg(target_os = "linux")] mod encrypted_filesystem; +#[cfg(target_os = "linux")] mod inode_cache; +#[cfg(target_os = "linux")] pub mod error; -pub use encrypted_filesystem::EncryptedFs; \ No newline at end of file +#[cfg(target_os = "linux")] +pub use encrypted_filesystem::EncryptedFs; diff --git a/rustcryptfs-mount/src/lib.rs b/rustcryptfs-mount/src/lib.rs index 7a51b40..107aa9d 100644 --- a/rustcryptfs-mount/src/lib.rs +++ b/rustcryptfs-mount/src/lib.rs @@ -1,12 +1,12 @@ use std::path::Path; -use rustcryptfs_fuse::EncryptedFs; - #[cfg(target_os = "linux")] pub fn mount

(path: P, mount_point: P, password: &str) -> rustcryptfs_fuse::error::Result<()> where P: AsRef, { + use rustcryptfs_fuse::EncryptedFs; + let fs = EncryptedFs::new(path, password)?; fs.mount(mount_point)?;