NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1098 most downloaded on crates.io
No libc, pure Rust cross-platform file locks. Original fs2, now supports async and replace libc by rustix.
Last release 5 months ago
28 Apr 2026
Ships unpredictably
gaps range from 2 weeks to 1.1 years
Rarely documented
notes for 5 of 28 stable releases
4 versions withdrawn
withdrawn after publishing
5 years old
32 releases · first in 2021
One column per quarter.
Consolidate FileExt and AsyncFileExt into single crate-root traits ( fs4::FileExt , fs4::AsyncFileExt ) instead of generating a distinct trait per bac
FileExt and AsyncFileExt into single crate-root traitsfs4::FileExt, fs4::AsyncFileExt) instead of generating a distinctfs4::tokio,fs4::async_std, fs4::smol, fs4::fs_err2, fs4::fs_err3,fs4::fs_err2_tokio, fs4::fs_err3_tokio) now re-export the unifieduseimpl<F: FileExt + ?Sized> FileExt for &F andimpl<F: AsyncFileExt + ?Sized> AsyncFileExt for &F, so theFileExt and AsyncFileExt via a private sealed::SealedDynAsyncFileExt, an object-safe mirror of AsyncFileExt whoseBoxFuture<'_, T> (alias forPin<Box<dyn Future<Output = T> + Send + '_>>). Use it wheneverBox<dyn DynAsyncFileExt>,&dyn DynAsyncFileExt); prefer the static AsyncFileExt forAsyncFileExt also implementsDynAsyncFileExt, and the trait is sealed.#[inline(always)] (skipped undertarpaulin coverage builds).Nothing published for this version
Unix allocate: short-circuit on allocated blocks (metadata().blocks() * 512 >= len) instead of logical EOF. The previous metadata().len() >= len check
allocate: short-circuit on allocated blocks
(metadata().blocks() * 512 >= len) instead of logical EOF. The
previous metadata().len() >= len check silently turned allocate
into a no-op on sparse files (logical length large, zero blocks
reserved), violating the documented preallocation guarantee. The
new check still skips the macOS F_PREALLOCATE re-allocate-ENOSPC
path from #15, since it asks the right question: "are the blocks
already reserved?" Applies to both the sync and async
implementations.statvfs: route the three GetDiskFreeSpaceExW outputs
correctly. free_space now comes from lpTotalNumberOfFreeBytes
(volume-wide, quota-independent), available_space from
lpFreeBytesAvailable (caller-scoped, honours per-user quotas),
and total_space is computed from cluster math
(sectors_per_cluster * bytes_per_sector * total_number_of_clusters)
so it reports volume capacity rather than the caller's quota. On
quota-enabled volumes the three fields now carry distinct,
documented meanings; previously free_space and available_space
were identical and total_space under-reported capacity.target_os = "fuchsia" to the Unix allocate fallocate
branch (sync and async). Fuchsia is cfg(unix) under rustc and
rustix exposes fallocate there, so the previous omission left
the Fuchsia Unix build without an allocate symbol once FileExt
was enabled. With this fix, every fs4 feature builds on Fuchsia
except fs-err3 and fs-err3-tokio; those remain blocked on
fs-err v3.3.0 referencing std::os::unix::fs::chroot, which
rustc gates out on target_os = "fuchsia". The fs4 code no longer
has a Fuchsia gap — the remaining one is upstream
(https://github.com/andrewhickman/fs-err/issues/90).allocate_reserves_blocks_on_sparse_file
(sync and async, Linux-gated) creates a sparse file via set_len,
asserts allocated_size == 0, calls allocate, and asserts
blocks are reserved.rust-version = "1.75.0") covers
the default sync feature, and that async-std / smol inherit
a higher effective MSRV (1.85) from their transitive dependencies
(async-lock, async-signal).Renamed FileExt::lock_exclusive / AsyncFileExt::lock_exclusive to lock , matching the stabilized [ std::File::lock ] API.
FileExt::lock_exclusive / AsyncFileExt::lock_exclusive tolock, matching the stabilized [std::fs::File::lock] API.FileExt::try_lock_exclusive / AsyncFileExt::try_lock_exclusivetry_lock, matching [std::fs::File::try_lock].try_lock and try_lock_shared fromstd::io::Result<bool> to Result<(), TryLockError>. Ok(()) stillErr(TryLockError::WouldBlock) nowstd::fs::File::try_lock] signature (Ok(false) was the nightlylock_contended_error() helper. UseTryLockError::WouldBlock instead.fs_std module: the FileExt trait forstd::fs::File now lives at the crate root. Update imports fromuse fs4::fs_std::FileExt; to use fs4::FileExt;. All otherfs_err2, fs_err3, tokio, smol, async_std,fs_err2_tokio, fs_err3_tokio) remain nested, since eachFileExt/AsyncFileExt over a different concreteFile type.fs4::TryLockError enum, mirroring [std::fs::TryLockError]Error(io::Error) and WouldBlock variants. ImplementsDebug, Display, std::error::Error (with source() exposingio::Error), From<io::Error> (kind WouldBlockWouldBlock variant; everything else wraps intoError), and From<TryLockError> for io::Error (WouldBlockio::Error::from(io::ErrorKind::WouldBlock); Error(inner)fs-err2, fs-err3, fs-err2-tokio, or fs-err3-tokio enabledsync / tokio). #[cfg(feature = "fs-err")] andfeature = "fs-err-tokio" both referenced feature names that do notCargo.toml.set_len call when the file's existinglen. Avoids the Windowslenallocate on Unix when the file is already at leastlen bytes long. Fixes macOS fallocate spuriously returningENOSPC when re-calling allocate(len) on an existing file (#15).cygwin to the allocate target_os set so builds stopsys::allocate symbol on that target (#44).redox and cygwin to the async allocate fallback branchfallocate branch to the set_lenlib.rs (#16).std::fs::File::lock / try_lock / unlock (stable inunstable_name_collisionslock_impl! macro with #[allow(unused_macros)] socargo clippy --no-default-features (filesystem-stats-only build)-D warnings.cfg_fs2_err / cfg_fs3_err fromlib.rs (unified with cfg_fs_err2 / cfg_fs_err3).html_root_url to the 1.0.0 docs.rs path.windows-sys from 0.59 to 0.61.#[bench] functions from the test harness. Theyflock, LockFileEx, fallocate, statvfs)#![cfg_attr(test, feature(test))]).rust-toolchain.toml is now stable.allocate_preserves_eof_within_cluster — exercises the #13AllocationSize with EOF insideallocate(len) islen <= allocated_size on Windows.allocate_idempotent — exercises the #15 precondition (back-to-backallocate(len) calls on macOS) to prevent a regression in theTryLockError unit tests covering variants, Display,std::error::Error::source, From<io::Error>, From<TryLockError> for io::Error, and round-trip preservation of ErrorKind.FsStats getter + derive unit tests (previously every testfilesystem_space test asserted available_space <= free_space,f_bavail butf_bfree, so the POSIX invariant is violated on every run.statvfs call plus destructure instead of three separate calls.github/workflows/coverage.yml workflow: per-OS matrixcargo tarpaulin --engine llvm --all-features --run-types tests --ignore-tests on each runner and uploading per-OS reports to--exclude-files the othercross job now installs the MinGW-w64 toolchain when targeting*-pc-windows-gnu. windows-sys 0.61 invokes dlltool duringubuntu-latest ships only the x86_64 MinGW toolchainfs4 = { version = "0.13", ... }fs4 = { version = "1", ... }..codecov.yml, rustfmt.toml (2-space indent,.github/workflows/loc.yml; removed the obsolete tea.yaml.Nothing published for this version
Make try_lock_* return std::Result , which is compatible with the upcoming std::File::try_lock* in std.
try_lock_* return std::io::Result<bool>, which is compatible with the upcoming std::fs::File::try_lock* in std.Nothing published for this version
Nothing published for this version
Nothing published for this version
Add *_async APIs for convenience when using fs4 with async runtimes.
*_async APIs for convenience when using fs4 with async runtimes.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Cleanup features and update dependencies.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →