Created
October 5, 2021 16:31
-
-
Save alexhallam/257fbda9c751fd56c6508bc5328b7c8a to your computer and use it in GitHub Desktop.
join paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use directories::{BaseDirs}; | |
use std::fs::{create_dir}; | |
fn main() { | |
if let Some(base_dirs) = BaseDirs::new() { | |
let config_path = base_dirs.config_dir(); | |
let more_path = create_dir(config_path + "/some/dir").unwrap(); | |
println!("{:?}",base_dirs.config_dir()); | |
// Linux: $XDG_CONFIG_HOME or $HOME/.config | |
// Windows: {FOLDERID_RoamingAppData} | |
// macOs: $HOME/Library/Application Support | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment