Skip to content

Conversation

@adamsitnik
Copy link
Member

the both call methods that throw on macOS:

private static void LockInternal(long position, long length)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_OSXFileLocking);
}
private static void UnlockInternal(long position, long length)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_OSXFileLocking);
}

@adamsitnik adamsitnik added this to the 6.0.0 milestone Jan 15, 2021
LockInternal(position, length);
}

[UnsupportedOSPlatform("macos")]
Copy link
Member

Choose a reason for hiding this comment

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

Presumably the ref needs to be updated, too?

Copy link
Member

Choose a reason for hiding this comment

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

Also, what about overrides? e.g. IsolatedStorageFileStream.Lock/Unlock?

Copy link
Member Author

Choose a reason for hiding this comment

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

@stephentoub excellent points (as usual). I've added missing attributes (ref & overrides) PTAL

Copy link
Member Author

Choose a reason for hiding this comment

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

I am sorry, I've missed the VB files... let me fix the build and get back to you

@adamsitnik
Copy link
Member Author

The CI failures come from #47374, the PR should be ready for review

End Sub

<UnsupportedOSPlatform("macos")>
Public Function InputString(ByVal FileNumber As Integer, ByVal CharCount As Integer) As String
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this API's area owner would prefer to reduce the aggressiveness of marking the whole platform as unsupported, and instead only calling oFile.Lock() and oFile.Unlock() when the platform is not MacOS.

Copy link
Contributor

@buyaa-n buyaa-n Feb 4, 2021

Choose a reason for hiding this comment

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

As far as I know, mono team has a story for adding more attributes for mac/android/ios, they might want to see this changes cc @marek-safar

Copy link
Contributor

Choose a reason for hiding this comment

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

That story is for SDKs but we are going to audit libraries as well during #47910 work

Copy link
Contributor

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

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

LGTM given that all the unit tests are failing with unrelated failures.

Copy link
Contributor

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@adamsitnik adamsitnik merged commit a98fe6c into dotnet:master Feb 8, 2021
@adamsitnik adamsitnik deleted the fileLockingIsUnsupportedOnOSX branch February 8, 2021 12:54
@ghost ghost locked as resolved and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants