fs_extra
Expanded std::fs and std::io for Rust — recursive copy and move with progress reporting.
Repository Health
Technical Analysis
fs_extra is a dependency-free Rust library that fills the gaps in the standard library’s std::fs and std::io modules. It adds the higher-level file and directory operations that real applications need but that std leaves out: recursively copying and moving whole directory trees, reporting live progress through callbacks, computing folder sizes, and enumerating directory contents with rich metadata.
Every operation is offered in both a simple form and a with_progress variant that streams TransitProcess information back to the caller, making it straightforward to build responsive CLIs and GUIs that show copy/move progress. With zero third-party dependencies and a small, well-documented surface area, fs_extra is a lightweight drop-in for filesystem-heavy Rust code.
What You Get
- Recursive directory copy and move via dir::copy, dir::move_dir, copy_items, and move_items
- Progress-aware variants (copy_with_progress, move_dir_with_progress) that stream TransitProcess updates for building responsive UIs
- Configurable CopyOptions (overwrite, skip_exist, buffer_size, content_only) that control how conflicts and buffering are handled
- Directory introspection helpers: dir::get_size, dir::get_dir_content, and dir::ls for sizes and child-entry details
- Convenience file helpers such as file::read_to_string and file::write_all, plus a typed Error/ErrorKind result type
Common Use Cases
- Copying or moving large directory trees while displaying a progress bar in a CLI or GUI
- Computing the total on-disk size of a folder before an operation
- Building installers, backup tools, and file-sync utilities that need recursive filesystem operations
- Listing directory contents with per-entry metadata for file explorers or asset pipelines
Under The Hood
Architecture The crate is organized into four flat modules — lib.rs (top-level copy_items/move_items/remove_items orchestration), dir.rs (recursive directory logic, the largest file at ~46KB), file.rs (single-file copy/move/read/write with CopyOptions), and error.rs (a custom Error/ErrorKind result type). Higher-level functions in lib.rs walk entries and delegate down to the file and dir primitives, and every mutating operation has a mirror *_with_progress form that threads a caller-supplied handler receiving a TransitProcess struct of byte and entry counts.
Tech Stack Pure Rust targeting edition 2018 with zero third-party dependencies — it builds entirely on std::fs and std::io. Progress buffering is tunable through CopyOptions.buffer_size (default 64KB). The only tooling is Cargo plus a legacy Travis CI config.
Code Quality The library is exceptionally well tested: roughly 9,700 lines of integration tests across tests/dir.rs, tests/file.rs, and tests/lib.rs against ~90KB of source. Errors are handled through a purpose-built ErrorKind enum that categorizes NotFound, PermissionDenied, AlreadyExists, InvalidFolder, and wrapped Io/StripPrefix/OsString failures rather than leaking raw std errors. Naming is consistent and the public functions carry doc comments with runnable examples.
API Design The public API is small, discoverable, and ergonomic: builder-style CopyOptions methods (overwrite, skip_exist, buffer_size) chain fluently, and the simple-vs-with_progress pairing lets users start trivially and opt into progress reporting without changing call sites. The README documents every function in a table with docs.rs links, so getting started requires almost no boilerplate.
Used by 3 apps in this directory
Enso
Analytics · Data Engineering · Low Code Platforms
A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.
Rivet
AI Agents · Developer Tools
Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.
Tabby
AI Code Assistants
Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.