al8n/fs4

Extended utilities for working with files and filesystems in Rust. This is a fork of the fs2-rs crate, the aim for this fork is to support async and replace libc with rustix.

Rust

120

132 commits

updated Apr 28, 2026

See the code

README

fs4

Extended utilities for working with files and filesystems in Rust.

This is a fork of the fs2-rs crate, the aim for this fork is to support async and replace libc by rustix.

github LoC Build codecov

docs.rs crates.io crates.io license

Installation

  • std

    [dependencies]
    fs4 = { version = "1", features = ["sync"] }
    
  • async-std runtime

    [dependencies]
    fs4 = { version = "1", features = ["async-std"] }
    
  • fs-err v2

    [dependencies]
    fs4 = { version = "1", features = ["fs-err2"] }
    
  • fs-err-tokio v2

    [dependencies]
    fs4 = { version = "1", features = ["fs-err2-tokio"] }
    
  • fs-err v3

    [dependencies]
    fs4 = { version = "1", features = ["fs-err3"] }
    
  • fs-err-tokio v3

    [dependencies]
    fs4 = { version = "1", features = ["fs-err3-tokio"] }
    
  • smol runtime

    [dependencies]
    fs4 = { version = "1", features = ["smol"] }
    
  • tokio runtime

    [dependencies]
    fs4 = { version = "1", features = ["tokio"] }
    

Features

Minimum Supported Rust Version

fs4 itself compiles on Rust 1.75.0 (the value of rust-version in Cargo.toml), and that guarantee covers the default sync feature.

Some opt-in features inherit a higher MSRV from their transitive dependencies — enabling them requires whatever toolchain those crates ask for, not what fs4 declares:

FeatureEffective MSRVReason
async-std1.85async-std pulls async-lock >= 3.4.2 (rust-version = 1.85)
smol1.85smol pulls async-signal >= 0.2.14 (rust-version = 1.85)

These bounds are set by upstream and can drift with future minor releases; pin the relevant dependency if you need an older toolchain.

Platform Notes

Fuchsia

Every feature builds on Fuchsia except fs-err3 and fs-err3-tokio. The blocker is upstream: fs-err v3.3.0 calls std::os::unix::fs::chroot, which rustc gates out on target_os = "fuchsia". The fs4 Unix modules themselves compile on Fuchsia (sync, fs-err2, async-std, smol, tokio all work). Tracking issue: https://github.com/andrewhickman/fs-err/issues/90.

License

fs4 is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2026 Al Liu.

Copyright (c) 2015 Dan Burkert.

rust
rust-lang
rust-library

al8n/fs4

Extended utilities for working with files and filesystems in Rust. This is a fork of the fs2-rs crate, the aim for this fork is to support async and replace libc with rustix.

Rust

120

132 commits

updated Apr 28, 2026

See the code

README

fs4

Extended utilities for working with files and filesystems in Rust.

This is a fork of the fs2-rs crate, the aim for this fork is to support async and replace libc by rustix.

github LoC Build codecov

docs.rs crates.io crates.io license

Installation

  • std

    [dependencies]
    fs4 = { version = "1", features = ["sync"] }
    
  • async-std runtime

    [dependencies]
    fs4 = { version = "1", features = ["async-std"] }
    
  • fs-err v2

    [dependencies]
    fs4 = { version = "1", features = ["fs-err2"] }
    
  • fs-err-tokio v2

    [dependencies]
    fs4 = { version = "1", features = ["fs-err2-tokio"] }
    
  • fs-err v3

    [dependencies]
    fs4 = { version = "1", features = ["fs-err3"] }
    
  • fs-err-tokio v3

    [dependencies]
    fs4 = { version = "1", features = ["fs-err3-tokio"] }
    
  • smol runtime

    [dependencies]
    fs4 = { version = "1", features = ["smol"] }
    
  • tokio runtime

    [dependencies]
    fs4 = { version = "1", features = ["tokio"] }
    

Features

Minimum Supported Rust Version

fs4 itself compiles on Rust 1.75.0 (the value of rust-version in Cargo.toml), and that guarantee covers the default sync feature.

Some opt-in features inherit a higher MSRV from their transitive dependencies — enabling them requires whatever toolchain those crates ask for, not what fs4 declares:

FeatureEffective MSRVReason
async-std1.85async-std pulls async-lock >= 3.4.2 (rust-version = 1.85)
smol1.85smol pulls async-signal >= 0.2.14 (rust-version = 1.85)

These bounds are set by upstream and can drift with future minor releases; pin the relevant dependency if you need an older toolchain.

Platform Notes

Fuchsia

Every feature builds on Fuchsia except fs-err3 and fs-err3-tokio. The blocker is upstream: fs-err v3.3.0 calls std::os::unix::fs::chroot, which rustc gates out on target_os = "fuchsia". The fs4 Unix modules themselves compile on Fuchsia (sync, fs-err2, async-std, smol, tokio all work). Tracking issue: https://github.com/andrewhickman/fs-err/issues/90.

License

fs4 is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2026 Al Liu.

Copyright (c) 2015 Dan Burkert.

rust
rust-lang
rust-library

Project health

crates.io

Latest release

1.1.0 · Apr 28, 2026

Releases this year

4

Significant stargazers

John Vandenberg

603 followers · starred Dec 2025

Jonas Platte

662 followers · starred Nov 2024

Jiahao XU

161 followers · starred Apr 2026

Joel Natividad

232 followers · starred Nov 2024