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

#477 in Filesystem

Download history 3303/week @ 2024-03-14 3907/week @ 2024-03-21 4021/week @ 2024-03-28 4110/week @ 2024-04-04 4559/week @ 2024-04-11 3973/week @ 2024-04-18 4004/week @ 2024-04-25 3859/week @ 2024-05-02 3736/week @ 2024-05-09 3410/week @ 2024-05-16 3086/week @ 2024-05-23 3525/week @ 2024-05-30 2857/week @ 2024-06-06 3119/week @ 2024-06-13 3451/week @ 2024-06-20 2816/week @ 2024-06-27

12,785 downloads per month
Used in 96 crates (5 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);
}

lib.rs:

Safe interface to <pwd.h>

This module, named after the python module with the same function, is a safe interafce to pwd.h on unix-y systems. Currently nothing from this module compiles on Windows, or attempts to make any kind of similar interface for Windows.

Dependencies

~290–790KB
~19K SLoC