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

#299 in Filesystem

Download history 4067/week @ 2024-07-21 3856/week @ 2024-07-28 4948/week @ 2024-08-04 3990/week @ 2024-08-11 3655/week @ 2024-08-18 3440/week @ 2024-08-25 3768/week @ 2024-09-01 3431/week @ 2024-09-08 3472/week @ 2024-09-15 3867/week @ 2024-09-22 3966/week @ 2024-09-29 4056/week @ 2024-10-06 4963/week @ 2024-10-13 4222/week @ 2024-10-20 4033/week @ 2024-10-27 3769/week @ 2024-11-03

17,330 downloads per month
Used in 129 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

~270–780KB
~18K SLoC