Skip to content

Conversation

StuartMosquera
Copy link
Contributor

Summary

  • This PR adds the missing examples for the EnumerateFiles method using the EnumerationOptions parameter for C#, F#, and VB.NET.

Fixes #10817

@StuartMosquera StuartMosquera requested a review from a team as a code owner September 8, 2025 16:36
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 8, 2025
@StuartMosquera
Copy link
Contributor Author

I'm going to change the type names so it compiles.

securityRules.AddAccessRule(new FileSystemAccessRule(@"Domain\account1", FileSystemRights.Read, AccessControlType.Allow));
securityRules.AddAccessRule(new FileSystemAccessRule(@"Domain\account2", FileSystemRights.FullControl, AccessControlType.Allow));

DirectoryInfo di = Directory.CreateDirectory(@"C:\destination\NewDirectory", securityRules);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @gewarren, this code is legacy, right? The second parameter of the CreateDirectory method is only for Unix-like systems, or am I wrong?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, looks like the 2-parameter overload takes a DirectorySecurity in .NET Framework and a UnixFileMode in .NET. So this project will need to target .NET Framework instead of .NET 9 since this example is used in the .NET Framework overload docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.IO community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No examples for EnumerateFiles(String, String, EnumerationOptions)

2 participants