7 releases (stable)

1.4.0 Jul 25, 2022
1.3.1 Mar 25, 2021
1.3.0 Mar 23, 2018
1.2.0 Sep 26, 2017
0.1.0 Sep 25, 2017

#282 in Filesystem

Download history 4790/week @ 2024-12-14 3866/week @ 2024-12-21 5148/week @ 2024-12-28 6729/week @ 2025-01-04 7356/week @ 2025-01-11 6584/week @ 2025-01-18 7268/week @ 2025-01-25 13157/week @ 2025-02-01 18850/week @ 2025-02-08 23629/week @ 2025-02-15 14041/week @ 2025-02-22 14100/week @ 2025-03-01 14983/week @ 2025-03-08 21505/week @ 2025-03-15 14148/week @ 2025-03-22 13363/week @ 2025-03-29

65,431 downloads per month
Used in 146 crates (6 directly)

CC-PDDC license

10KB
130 lines

pwd module for unix-y systems

link link="https://deps.rs/repo/gitlab/pwoolcoc/pwd",alt="dependency status"

This is a small veneer over pwd.h, mostly just hides away the unsafe parts.

Installation

In the [dependencies] section of your Cargo.toml, add the following line:

[source="rust"]

[dependencies]
pwd = "1"

Usage

[source="rust"]

use pwd::Passwd;

fn main() {
    let me = Passwd::current_user();
    println!("my username is {}, home directory is {}, and my shell is {}. My uid/gid are {}/{}",
             me.name, me.dir, me.shell, me.uid, me.gid);
}

Dependencies

~210–690KB
~16K SLoC