Skip to content

Clarify MatchCasing does not affect directory path resolution#12452

Open
rtmongold wants to merge 2 commits intodotnet:mainfrom
rtmongold:fix-matchcasing-docs
Open

Clarify MatchCasing does not affect directory path resolution#12452
rtmongold wants to merge 2 commits intodotnet:mainfrom
rtmongold:fix-matchcasing-docs

Conversation

@rtmongold
Copy link
Copy Markdown

Fixes dotnet/runtime#115356

Summary

This PR clarifies that EnumerationOptions.MatchCasing applies only to file name pattern matching and does not affect directory path resolution.

On case-sensitive file systems (e.g., Linux and macOS), directory paths must match the exact casing even if MatchCasing = CaseInsensitive.

Motivation

Users may assume that MatchCasing affects the full path when performing searches. In reality, it only applies to file name pattern matching, which can be misleading on case-sensitive systems. This update improves documentation to reduce confusion.

Changes

  • Updated XML doc comment in EnumerationOptions.cs (runtime repo)
  • Updated API XML (EnumerationOptions.xml) with <remarks> clarifying:
    • Scope is limited to file name matching
    • Directory paths are unaffected
    • Default behavior is platform-dependent
  • Optional example included in API XML to illustrate Linux behavior

Example (API docs)

Directory.GetFiles("/tmp/data", "*.TXT",
    new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive });
@rtmongold rtmongold requested a review from a team as a code owner March 27, 2026 05:23
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 27, 2026
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 27, 2026
@dotnet-policy-service dotnet-policy-service bot removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 27, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-io

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

2 participants