#file-lock #file #lock #duplicate #flock #fs2

fs4

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

22 releases (6 breaking)

0.12.0 Nov 30, 2024
0.10.0 Oct 8, 2024
0.9.1 Jul 30, 2024
0.8.1 Mar 8, 2024
0.5.4 Dec 31, 2021

#23 in Filesystem

Download history 167670/week @ 2024-08-19 174593/week @ 2024-08-26 170476/week @ 2024-09-02 163646/week @ 2024-09-09 155984/week @ 2024-09-16 166282/week @ 2024-09-23 169532/week @ 2024-09-30 173150/week @ 2024-10-07 169036/week @ 2024-10-14 158506/week @ 2024-10-21 149913/week @ 2024-10-28 173613/week @ 2024-11-04 164690/week @ 2024-11-11 169835/week @ 2024-11-18 178151/week @ 2024-11-25 204765/week @ 2024-12-02

726,220 downloads per month
Used in 188 crates (52 directly)

MIT/Apache

81KB
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.12", features = ["sync"] }
    
  • async-std runtime

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

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

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

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

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

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

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

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

~1–13MB
~164K SLoC