#home-dir #directory

simple-home-dir

Returns the path of the current user's home directory if known

22 releases

Uses new Rust 2024

0.5.2 Jul 26, 2025
0.5.0 Feb 27, 2025
0.4.5 Dec 2, 2024
0.4.4 Nov 5, 2024
0.1.1 Mar 31, 2023

#946 in Filesystem

Download history 757/week @ 2025-12-07 249/week @ 2025-12-14 474/week @ 2025-12-21 332/week @ 2025-12-28 378/week @ 2026-01-04 439/week @ 2026-01-11 886/week @ 2026-01-18 539/week @ 2026-01-25 535/week @ 2026-02-01 932/week @ 2026-02-08 744/week @ 2026-02-15 770/week @ 2026-02-22 1050/week @ 2026-03-01 1188/week @ 2026-03-08 898/week @ 2026-03-15 927/week @ 2026-03-22

4,109 downloads per month
Used in 19 crates (15 directly)

MIT license

3KB

simple-home-dir

Crate

Deprecated: This crate is no longer necessary as Rust now provides an official home_dir() method. Use std::env::home_dir() instead.

Usage

Simply use the standard library's built-in home_dir method.

pub use std::env::home_dir;

fn main() {
    // Unix     =>  /home/jdoe
    // Windows  =>  C:\Users\jdoe
    let path = home_dir().unwrap();
}

No runtime deps