Safe wrappers for libbtrfsutil.
This library links to libbtrfsutil
, a shared library provided by installing btrfs-progs on most Linux systems.
# pacman -S btrfs-progs
# apt install btrfs-progs
Add this to your Cargo.toml
:
toml
[dependencies]
btrfsutil = "0.1.0"
For further details, please refer to the documentation.
Also, please keep in mind that many of the operations this library can perform may require elevated privileges(CAPSYSTEMADMIN).
How to run examples with elevated privileges:
cargo build --examples
sudo target/debug/examples/example_name
.This example requires elevated privileges.
```Rust // This will print out informations about all subvolumes under /
// Retrieve the subvolume for / let root_subvol = Subvolume::get("/").unwrap();
// Retrieve a subvolume iterator for /
let subvoliterator: SubvolumeIterator = {
let result: Result
// Iterate over the subvolumes and print out their debug information for subvolume in subvol_iterator { println!("{:?}", subvolume.info().unwrap()); } ```
MIT