#file-lock #file #lock #duplicate #locking #fs2

fs4

No libc, pure Rust cross-platform file locks. Original fs2, now supports async and replace libc by rustix.

16 unstable releases (3 breaking)

0.8.2 Apr 2, 2024
0.8.1 Mar 8, 2024
0.8.0 Feb 25, 2024
0.7.0 Sep 30, 2023
0.5.4 Dec 31, 2021

#29 in Filesystem

Download history 36759/week @ 2023-12-23 94838/week @ 2023-12-30 128819/week @ 2024-01-06 98957/week @ 2024-01-13 80511/week @ 2024-01-20 74982/week @ 2024-01-27 81879/week @ 2024-02-03 96917/week @ 2024-02-10 85692/week @ 2024-02-17 99317/week @ 2024-02-24 89024/week @ 2024-03-02 91387/week @ 2024-03-09 96196/week @ 2024-03-16 90751/week @ 2024-03-23 104289/week @ 2024-03-30 90631/week @ 2024-04-06

397,536 downloads per month
Used in 118 crates (33 directly)

MIT/Apache

79KB
1.5K SLoC

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 Build codecov

docs.rs crates.io crates.io

license

Installation

  • std

    [dependencies]
    fs4 = { version = "0.8", features = ["sync"] }
    
  • tokio runtime

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

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

    [dependencies]
    fs4 = { version = "0.8", features = ["smol"] }
    

Features

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) 2021 Al Liu.

Copyright (c) 2015 Dan Burkert.

Dependencies

~2–16MB
~184K SLoC