Skip to content

Add a file locking API to std::io::fs #11213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Dretch opened this issue Dec 30, 2013 · 5 comments
Closed

Add a file locking API to std::io::fs #11213

Dretch opened this issue Dec 30, 2013 · 5 comments

Comments

@Dretch
Copy link
Contributor

Dretch commented Dec 30, 2013

Some sort of portable advisory file locking API would be useful to me.

Perhaps like http://www.php.net/manual/en/function.flock.php.

I can look into sending a pull request if there are no objections.

@alexcrichton
Copy link
Member

It doesn't look like libuv currently has support for this, so this would probably involve adding support for a locking API to libuv as well. Sounds like a good idea though!

@thestinger
Copy link
Contributor

File locking is a disaster, and doesn't really work properly:

The semantics aren't going to be portable across operating systems, because POSIX locks are unusable. The BSD locking API is somewhat sane, but I don't think you're going to find a 1:1 equivalent on Windows.

@brson
Copy link
Contributor

brson commented Dec 31, 2013

I also think that locking is too unportable to put in std.

@gereeter
Copy link
Contributor

If this is too unportable to be implemented, should this be closed?

@alexcrichton
Copy link
Member

Yes, it sounds like this shouldn't be added to libstd at this time.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 31, 2023
check that the types are equal in `SpanlessEq::eq_expr`

Fixes rust-lang#11213

changelog: [`if_same_then_else`]: don't lint for integer literals of different types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants