brunoczim / fslock

File locking for Rust.
MIT License
40 stars 11 forks source link

Implement AsFd, AsRawFd, AsHandle, and AsRawHandle. #15

Open nmathewson opened 7 months ago

nmathewson commented 7 months ago

These traits can be leveraged to access an open LockFile for purposes like inspecting its metadata, or opening it as a File.

Importantly, these traits can't easily be misused to unlock or close a LockFile prematurely: to do so, you'd have to write unsafe code.

nmathewson commented 7 months ago

Hi! No rush, but do you think you might have a chance to look at this some time this month? We need it in Arti to check the age of a lock file, and to implement safe deletion for lock files.

nmathewson commented 7 months ago

We've had to make a fork (hopefully a temporary one!) to get this feature for now.

In case you're curious, here's how we're using it.

nmathewson commented 6 months ago

Hello! Just checking in. Please let me know if there's anything I answer, change, or do in order to make this easier to review.