Skip to content

TestingHelpers: Lazily create File|DirectorySecurity for better suppo…#273

Closed
fgreinacher wants to merge 2 commits intoTestableIO:masterfrom
fgreinacher:linux-compat
Closed

TestingHelpers: Lazily create File|DirectorySecurity for better suppo…#273
fgreinacher wants to merge 2 commits intoTestableIO:masterfrom
fgreinacher:linux-compat

Conversation

@fgreinacher
Copy link
Copy Markdown
Contributor

…rt on non-Windows OSes

Both FileSecurity and DirectorySecurity are not supported on non-Windows OSes and will throw PlatformNotSupportedException when called. MockDirectoryData & FileDirectoryData create instances of them when they are created. This makes them unusable on non-Windows OSes even if the actual *Security functionality is not used.

This change delays their creation to the point where they are actually necessary. That makes them usable again as long as *Security functioanlity is not used.

Fixes #272

fgreinacher and others added 2 commits February 7, 2018 17:21
…rt on non-Windows OSes

Both FileSecurity and DirectorySecurity are not supported on non-Windows OSes and will throw PlatformNotSupportedException when called. MockDirectoryData & FileDirectoryData create instances of them when they are created. This makes them unusable on non-Windows OSes even if the actual *Security functionality is not used.

This change delays their creation to the point where they are actually necessary. That makes them usable again as long as *Security functioanlity is not used.
@fgreinacher
Copy link
Copy Markdown
Contributor Author

@tathamoddie Would be great to have this reviewed. This issue prevents using the library on any non-Windows system. Thanks!

@tathamoddie
Copy link
Copy Markdown
Contributor

Hi @fgreinacher. How do we know this won't regress in future? Can you add any tests?

@fgreinacher
Copy link
Copy Markdown
Contributor Author

Sure, I'll try to get the test running on Travis CI to ensure unix compatbility.

@verybadcat
Copy link
Copy Markdown

Possibly related -- one can't install System.IO.Abstractions into a Xamarin.IOS project, again because of the Security types. The version of System.IO used by Xamarin.IOS does contain System.Security.AccessControl.

@tathamoddie
Copy link
Copy Markdown
Contributor

#289 fixed this with comments

@tathamoddie tathamoddie closed this Jul 4, 2018
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

Successfully merging this pull request may close these issues.

3 participants