Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Remove OSX FileStream Lock/Unlock#9769

Merged
ianhays merged 2 commits into
dotnet:masterfrom
ianhays:filelock_osx
Feb 24, 2017
Merged

Remove OSX FileStream Lock/Unlock#9769
ianhays merged 2 commits into
dotnet:masterfrom
ianhays:filelock_osx

Conversation

@ianhays
Copy link
Copy Markdown

@ianhays ianhays commented Feb 24, 2017

OSX doesn't support usage of both fcntl and flock. Since we're already using one in FileShare for the entire file, we cannot enable partial file locking like we do on other Unix platforms. The alternative is to throw a PNSE and suggest using FileShare on the whole file instead.

resolves https://github.com/dotnet/corefx/issues/5964

@stephentoub @JeremyKuhne

OSX doesn't support usage of both fcntl and flock. Since we're already using one in FileShare for the entire file, we cannot enable partial file locking like we do on other Unix platforms. The alternative is to throw a PNSE and suggest using FileShare on the whole file instead.
@ianhays ianhays added area-System.IO bug Product bug (most likely) labels Feb 24, 2017
@ianhays ianhays added this to the 2.0.0 milestone Feb 24, 2017
@ianhays ianhays self-assigned this Feb 24, 2017
PlatformNotSupported_NamedSynchronizationPrimitives=The named version of this synchronization primitive is not supported on this platform.
PlatformNotSupported_NamedSyncObjectWaitAnyWaitAll=Wait operations on multiple wait handles including a named synchronization primitive are not supported on this platform.
; OSX File locking
PlatformNotSupported_OSXFileLocking=Locking/unlocking file regions is not supported. Use FileShare on the entire file instead.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have "supported on this platform" in the string.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@ianhays ianhays merged commit 70d8a4d into dotnet:master Feb 24, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Remove OSX FileStream Lock/Unlock

Commit migrated from dotnet/coreclr@70d8a4d
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.IO bug Product bug (most likely)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose existing FileStream.Lock() and FileStream.Unlock() APIs on MacOS/Unix

4 participants