Skip to content

veeso/pavao

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

67 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PavΓ£o

pavao logo

~ A Rust client library for SMB ~

Get started Β· Crates.io Β· Documentation

Developed by @veeso

Current version: 0.2.10 (21/02/2025)

License-GPLv3 Repo stars Downloads counter Latest version Ko-fi

Linux CI MacOS CI Coveralls Docs



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.

PavΓ£o |> PavΓ© |> Animal Crossing |> Carnival |> Rio De Janeiro |> Samba |> SMB

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 πŸ¦€

pavao = "0.2"

Install pavao C dependencies on your system πŸ–₯️

MacOS 🍎

Install samba with brew:

brew install samba

Debian based systems 🐧

Install libsmbclient with apt:

apt install -y libsmbclient-dev libsmbclient

⚠️ libsmbclient-dev is required only on the machine where you build the application

RedHat based systems 🐧

Install libsmbclient with dnf:

dnf install libsmbclient-devel libsmbclient

⚠️ libsmbclient-devel is required only on the machine where you build the application

OpenBSD 🐑

Install samba with pkg_add:

pkg_add samba

Termux πŸ€–

Install samba with pkg:

pkg install samba

Build from sources πŸ“

Install libsmbclient building from sources:

wget -O samba.tar.gz https://github.com/samba-team/samba/archive/refs/tags/samba-4.16.1.tar.gz
mkdir -p samba/
tar  xzvf samba.tar.gz -C samba/ --strip-components=1
rm samba.tar.gz
cd samba/
./configure
make
make install
cd ..
rm -rf samba/

Create a pavao application

use pavao::{SmbClient, SmbCredentials, SmbOptions, SmbOpenOptions};

// Initialize a new client
let client = SmbClient::new(
    SmbCredentials::default()
        .server(server)
        .share(share)
        .password(password)
        .username(username)
        .workgroup(workgroup),
    SmbOptions::default().one_share_per_server(true),
)
.unwrap();
// do anything you want here with client
let mut file = client.open_with("/abc/test.txt", SmbOpenOptions::default().read(true)).unwrap();
// read file...
drop(file);
// disconnect from server
drop(client);

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:

cargo run --example tree -- -u <username> -w <workspace> -s <share> -P <password> smb://<hostname>

while the transfer example shows how to write a file to the remote host and can be run with:

cargo run --example transfer -- -i <file_on_local> -o <file_to_write> -u <username> -w <workspace> -s <share> -P <password> smb://<hostname>

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:

ko-fi PayPal


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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy