Pavão
- Pavão
About Pavão 🦚
Pavão (/pɐ.ˈvɐ̃w̃/) is a Rust client library for SMB version 2 and 3 which exposes type-safe functions to interact with the C libsmbclient.
SMB Rust client for Windows
SMB is natively supported on Windows by the fs module. If you're looking on how to use SMB on Windows with Rust, please check out this article https://blog.veeso.dev/blog/en/how-to-access-an-smb-share-with-rust-on-windows/ or consider adopting remotefs-smb.
Get started 🏁
Add pavao to your Cargo.toml 🦀
= "0.2"
Install pavao C dependencies on your system 🖥️ (not vendored)
MacOS 🍎
Install samba with brew:
Debian based systems 🐧
Install libsmbclient with apt:
⚠️ libsmbclient-dev is required only on the machine where you build the application
RedHat based systems 🐧
Install libsmbclient with dnf:
⚠️ libsmbclient-devel is required only on the machine where you build the application
OpenBSD 🐡
Install samba with pkg_add:
Termux 🤖
Install samba with pkg:
Build from sources 📁
Install libsmbclient building from sources:
Vendored libsmbclient
It is possible to build libsmbclient statically when building pavao.
To do so it is enough to enable the vendored feature for the pavao crate in your Cargo.toml:
= { = "0.2", = ["vendored"] }
[!CAUTION] Mind that libsmbclient is a bloated library with tons of dependencies, so the vendored feature will increase the size of the final binary and may not work on all platforms.
In order to build and run with the vendored feature YOU MUST have the following libraries in your LD_LIBRARY_PATH:
see DEPENDENCIES
Create a pavao application
use ;
// Initialize a new client
let client = new
.unwrap;
// do anything you want here with client
let mut file = client.open_with.unwrap;
// read file...
drop;
// disconnect from server
drop;
Run examples
Two examples are provided along with this repository and can be found under the examples/ directory.
The tree example can be used to get a fs tree of the smb share and can be run with:
while the transfer example shows how to write a file to the remote host and can be run with:
Documentation 📚
The developer documentation can be found on Rust Docs at https://docs.rs/pavao
Support the developer ☕
If you like Pavão and you're grateful for the work I've done, please consider a little donation 🥳
You can make a donation with one of these platforms:
Contributing and issues 🤝🏻
Contributions, bug reports, new features and questions are welcome! 😉 If you have any question or concern, or you want to suggest a new feature, or you want just want to improve pavao, feel free to open an issue or a PR.
Please follow our contributing guidelines
Changelog ⏳
View Pavão's changelog HERE
License 📃
Pavão is licensed under the GPLv3 license.
You can read the entire license HERE