Crates.io | quick_file |
lib.rs | quick_file |
version | 0.2.0 |
source | src |
created_at | 2022-02-14 17:50:59.667496 |
updated_at | 2022-02-16 13:04:02.743703 |
description | Quickly read and write to files without needing to worry about file paths and operating systems |
homepage | |
repository | https://github.com/KJ002/quick_file |
max_upload_size | |
id | 532331 |
size | 4,651 |
Quickly read and write to files without needing to worry about file paths and operating systems
Usage is pretty easy, as this is what this crate is designed for. Your code should look something like this:
let config = ConfigManager::new("foobar");
let lorem_ipsum = "
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
";
config.write("lorem.txt", lorem_ipsum);
If this is ran on Windows this would create a folder in the location of the users appdata (%APPDATA%
) named foobar
. However, on Linux and MacOS a folder named foobar
would be created at the location of the users home (~
), this is determined by the HOME
environment variable and likewise the location of %APPDATA%
is determined by the APPDATA
environment variable.