Skip to content
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

Use MatchOptions::default() to disable case-sensitivity #622

Merged

Conversation

andrews05
Copy link
Collaborator

Fixes #621

@AlexTMjugador
Copy link
Collaborator

AlexTMjugador commented Jun 2, 2024

I find this change reasonable for Windows environments. The Win32 API goes to great lengths to present a case-insensitive view of the file system, even if the filesystem itself is case-sensitive. Therefore, many users reasonably expect this behavior.

However, in Linux environments, it's customary to always treat file names in a case-sensitive manner. For instance, when I run stat *.png on my zsh terminal at a Linux box, it ignores files with a .PNG extension. So this change would conflict with these expectations.

Most other Unix-like, POSIX-compliant systems should behave similarly to Linux in this regard. However, I’ve read that macOS is an exception, being case-insensitive by default. (I'm not a macOS user, so please correct me if I'm wrong!)

What do you think about modifying this PR to use #[cfg] attributes (or cfg! macros) for different glob case-sensitivity based on the target OS? I think this approach would accommodate the different expectations of users on various platforms pretty neatly.

@andrews05
Copy link
Collaborator Author

@AlexTMjugador You’re correct, but glob here is only used on Windows so it doesn’t affect other platforms.

@AlexTMjugador
Copy link
Collaborator

Ah, right, my bad, the function this PR modifies has a #[cfg(windows)] just above it that I completely overlooked. Let's merge this then!

@AlexTMjugador AlexTMjugador merged commit 90ceef9 into shssoichiro:master Jun 4, 2024
10 checks passed
@andrews05 andrews05 deleted the fix/glob-case-insensitive branch June 26, 2024 04:40
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.

Case sensitive names under Windows
2 participants