fs-more
Convenient file and directory operations built on top of std::fs with improved error handling.
Includes copying / moving files and directories with progress reporting.
Main features
- copying and moving files or directories with in-depth configuration options (including IO buffering settings, copying depth, etc.),
- optionally, copying and moving files or directories with progress reporting,
- scanning directories with depth and other options, and
- calculating file or directory sizes.
Usage
To add fs-more into your project, specify it in your Cargo.toml file:
= "0.2.2"
Examples
Copying a file with a progress handler:
use Path;
use FileError;
use FileCopyWithProgressOptions;
let source_path = new;
let target_path = new;
let copy_result = copy_file_with_progress?;
Moving a directory with a progress handler:
use Path;
use DirectoryError;
use DirectoryMoveWithProgressOptions;
use TargetDirectoryRule;
let source_path = new;
let target_path = new;
let move_result = move_directory_with_progress?;
Feature flags
The following feature flags are available:
fs-err: enables the optionalfs-errsupport, enabling more helpful underlying IO error messages (thoughfs-morealready provides many on its own).
Project status
This crate lacks some more thorough battle-testing. As such, use it with reasonable caution and testing.
Most features have been added, but it is possible some smaller ones will turn up missing.
For now, I plan on keeping the version below 1.0.0 to imply that
this hasn't gone though a lot.
However, quite a few unit, doc- and integration tests have been written. They cover a wide array of the base functionality, but fringe cases might not be covered yet — contributions are welcome!
Contributing and development
Want to contribute? Awesome!
Start by going over the contribution guide: CONTRIBUTING.md.
Attribution
fs-more isn't a fork, but has been inspired by
some of the functionalities of the fs_extra library (thank you!).