6 releases (stable)

Uses old Rust 2015

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

#122 in Filesystem

Download history 184/week @ 2021-04-05 228/week @ 2021-04-12 242/week @ 2021-04-19 295/week @ 2021-04-26 197/week @ 2021-05-03 204/week @ 2021-05-10 205/week @ 2021-05-17 233/week @ 2021-05-24 220/week @ 2021-05-31 192/week @ 2021-06-07 250/week @ 2021-06-14 226/week @ 2021-06-21 225/week @ 2021-06-28 242/week @ 2021-07-05 223/week @ 2021-07-12 227/week @ 2021-07-19

827 downloads per month
Used in 13 crates (4 directly)

CC-PDDC license

9KB
129 lines

= pwd module for unix-y systems

image::https://img.shields.io/crates/v/pwd.svg?style=flat-square[link="https://crates.io/crates/pwd",alt="crates.io"] image::https://deps.rs/repo/gitlab/pwoolcoc/pwd/status.svg[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

In your crate root, add:

[source="rust"]

extern crate pwd;

=== Example

[source="rust"]

extern crate pwd;

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

~88KB