Open
Description
Feature gate: #![feature(file_lock)]
This is a tracking issue for rust-lang/libs-team#412
This feature exposes advisory file locks on File
. They allow a file handle to acquire an exclusive or shared file lock, which blocks other file handles to the same file from acquiring a conflicting lock. Some semantics are platform dependent, and these are documented in the API documentation.
Public API
impl File {
fn lock(&self) -> io::Result<()>;
fn lock_shared(&self) -> io::Result<()>;
fn try_lock(&self) -> io::Result<bool>;
fn try_lock_shared(&self) -> io::Result<bool>;
fn unlock(&self) -> io::Result<()>;
}
Steps / History
- Implementation: Implement file_lock feature #130999
- Final comment period (FCP)1
- Signature changed due to feedback: Change signature of File::try_lock and File::try_lock_shared #139343
- Signature changed again due to feedback: Change File::try_lock() and try_lock_shared() to return io::Result<()> #140718
- Simpler error propagation: Add From<TryLockError> for io::Error #141312
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
Metadata
Metadata
Assignees
Labels
Category: An issue tracking the progress of sth. like the implementation of an RFCNominated for discussion during a libs-api team meeting.Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.