-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
[API Proposal]: Add FileAttributes.None #83125
Comments
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsBackground and motivationSimilar to #79868, but for System.IO.FileAttributes. One use-case for the
API Proposalnamespace System.IO;
[System.Flags]
public enum FileAttributes
{
None = 0,
// Existing values:
// ReadOnly
// Hidden
// ... API UsageDirectory.EnumerateFiles("folder", "*", new System.IO.EnumerationOptions()
{
AttributesToSkip = FileAttributes.None,
}); Could also be used in runtime/src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerator.Unix.cs Line 132 in 967250c
Alternative DesignsNo response RisksNo response
|
Could this skip files without attributes? |
The current implementation skips the check for specific attributes when it's set to 0. I'm not sure we want to change this behavior. |
LGTM as proposed, I am going to present it for the API Review Board. |
namespace System.IO;
[System.Flags]
public enum FileAttributes
{
None = 0,
// Existing members omitted
} |
Background and motivation
Similar to #79868, but for System.IO.FileAttributes.
One use-case for the
0
value is when enumerating files.0
allows to not exclude files from enumeration based on their attributes.API Proposal
API Usage
Could also be used in
runtime/src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerator.Unix.cs
Line 132 in 967250c
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: