Skip to content

Add SubFileSystem constructor argument for ordinal compare choices#106

Merged
xoofx merged 8 commits into
xoofx:mainfrom
joshuascript:subfilesystem-ignorecase
Jun 8, 2026
Merged

Add SubFileSystem constructor argument for ordinal compare choices#106
xoofx merged 8 commits into
xoofx:mainfrom
joshuascript:subfilesystem-ignorecase

Conversation

@joshuascript

@joshuascript joshuascript commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

For issue #105

Kind of new to submitting PRs but I tried my best to stage this well (emerging college student).

Add a SubFileSystem overload to allow ordinal compare to be chosen without needing an inherited class.
That way I can do new SubFileSystem( system, path, StringComparison.OrdinalIgnoreCase, false ) instead of
overriding ConvertPathFromDelegate.

I also created an overload for UPathExtensions.IsInDirectory so that the decided ordinal can resolve the same way,
otherwise when a path is checked in a given directory it may return false even if ConvertPathFromDelegate is true.

FileSystemWatcher's ShouldRaiseEventImpl returns args.FullPath.IsInDirectory(Path, IncludeSubdirectories), by default, so I included a small override that is the same thing but with the ordinal choice.

I added new tests for to make sure ordinal still works by default and can be overriden to use the new string compare. There is also a skipped test for FilterPattern because that also is case-insensitive by default when comparing globs, but that's a separate PR for a separate day.

Am I headed in the right direction?

@joshuascript joshuascript changed the title Subfilesystem ignorecase Add SubFileSystem constructor argument for ordinal compare choices Jun 2, 2026
@joshuascript joshuascript marked this pull request as draft June 2, 2026 07:56
@joshuascript joshuascript marked this pull request as ready for review June 2, 2026 08:39
Comment thread src/Zio/FileSystems/SubFileSystem.cs Outdated
@joshuascript joshuascript requested a review from xoofx June 8, 2026 04:51
@xoofx xoofx merged commit a163dc2 into xoofx:main Jun 8, 2026
2 checks passed
@xoofx

xoofx commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Thanks!

@joshuascript

Copy link
Copy Markdown
Contributor Author

Nice working with you. Much appreciated.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants