18 releases (6 stable)
1.4.0 | Feb 15, 2024 |
---|---|
1.3.0 | Feb 7, 2024 |
1.0.0 | Jan 13, 2024 |
0.3.9 | Dec 2, 2023 |
0.1.0 | Nov 23, 2023 |
#345 in Science
327 downloads per month
Used in 3 crates
31KB
624 lines
filey-rs
A collection of utilities to make file operations more convenient.
Install
Run the following Cargo command in your project directory:
cargo add filey
Or add the following line to your Cargo.toml:
filey = "1.4.0"
Examples
Move a file to git repository and create symbolic link.
use filey::Filey;
let mut vimrc = Filey::new("~/.vimrc").expand_user()?;
let mut f = vimrc.move_to("dotfiles/")?;
f.symlink(&vimrc.path())?;
lib.rs
:
filey
'filey' is a collection of utilities to make file operations more convenient.
This library is made up of three main components:
A Basic example
use filey::Filey;
#
use filey::{Filey, FileTypes};
let mut file = Filey::new(".great_app.conf").create(FileTypes::File)?;
let file_size = file.size()?;
println!("{}", file_size); // 0
let dotfile = file.move_to("dotfiles/")?;
dotfile.symlink(".great_app.conf")?;
Dependencies
~2.9–9MB
~92K SLoC