#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.

17 unstable releases (3 breaking)

new 0.8.3 May 9, 2024
0.8.1 Mar 8, 2024
0.7.0 Sep 30, 2023
0.6.6 Jul 3, 2023
0.5.4 Dec 31, 2021

#27 in Filesystem

Download history 77201/week @ 2024-01-23 75338/week @ 2024-01-30 83029/week @ 2024-02-06 96856/week @ 2024-02-13 89806/week @ 2024-02-20 96872/week @ 2024-02-27 91288/week @ 2024-03-05 90410/week @ 2024-03-12 98170/week @ 2024-03-19 88497/week @ 2024-03-26 108607/week @ 2024-04-02 112088/week @ 2024-04-09 110408/week @ 2024-04-16 110217/week @ 2024-04-23 98142/week @ 2024-04-30 78181/week @ 2024-05-07

419,497 downloads per month
Used in 125 crates (37 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

~1–13MB
~164K SLoC