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

21 unstable releases (5 breaking)

new 0.11.1 Nov 7, 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

#22 in Filesystem

Download history 189266/week @ 2024-07-18 194597/week @ 2024-07-25 189711/week @ 2024-08-01 180479/week @ 2024-08-08 173411/week @ 2024-08-15 172816/week @ 2024-08-22 162558/week @ 2024-08-29 176129/week @ 2024-09-05 159386/week @ 2024-09-12 160320/week @ 2024-09-19 165504/week @ 2024-09-26 179824/week @ 2024-10-03 168990/week @ 2024-10-10 158042/week @ 2024-10-17 157106/week @ 2024-10-24 163818/week @ 2024-10-31

683,156 downloads per month
Used in 174 crates (48 directly)

MIT/Apache

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

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

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

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

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

    [dependencies]
    fs4 = { version = "0.11", 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
~163K SLoC