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

Allow fs.find to be case insensitive #752

Open
Jummit opened this issue Mar 26, 2021 · 4 comments
Open

Allow fs.find to be case insensitive #752

Jummit opened this issue Mar 26, 2021 · 4 comments
Labels
area-Core This affects CC's core (the Lua runtime, APIs, computer internals). enhancement An extension of a feature or a new feature.

Comments

@Jummit
Copy link
Contributor

Jummit commented Mar 26, 2021

fs.find is a very powerful function, but it lacks a case-insesitive option for it to be usable imo. A simple caseSensitive parameter would suffice.

e.g.

find(path, caseSensitive)
@Jummit Jummit added the enhancement An extension of a feature or a new feature. label Mar 26, 2021
@MCJack123
Copy link
Contributor

I think this is going to depend on whether or not your underlying filesystem is case-sensitive. NTFS has case-sensitivity, but it's hidden while running under Windows. HFS+ on macOS is also case-insensitive by default. Linux is the only OS (where Minecraft runs) where case-sensitivity is the default. So for operating systems/filesystems with case sensitivity disabled, adding a caseSensitive option isn't going to be useful.

@SquidDev SquidDev added the area-Core This affects CC's core (the Lua runtime, APIs, computer internals). label Apr 13, 2021
@sir-maniac
Copy link

sir-maniac commented May 14, 2021

CC is pretty much designed not to give access to the real world(with a few exceptions).

Maybe the filesystem should be case-insensitive on all platforms, which wouldn't be too hard to detect and mitigate.

@Ocawesome101
Copy link
Contributor

As a Linux user, case-sensitivity by default is really nice*. I support adding this option even if it doesn't do anything on some platforms. And the StackOverflow post @sir-maniac linked seems to provide a method for providing case-sensitivity on Windows and Linux (and, let's face it, Mac users probably make up a minority of CC users.** Also, iirc macOS's case-insensitive filesystems can still be partially case-sensitive, since Bash still acts like things are case-sensitive even on a case-insensitive filesystem).

*At least, I'm used to it.
** Then again, there may well be Linux users of CC than Mac users.

@sir-maniac
Copy link

sir-maniac commented Oct 15, 2021

IMHO it would be useful to default to case-insensitivity so a person can write scripts on Windows(or Mac), share them with people(who often will use them on servers, which are likely Linux), and the scripts will "just work."

@Ocawesome101, I personally like case-sensitivity too. But many novice programmers will likely not be thinking of case when they are accessing their own files on Windows(or Mac), which will silently break after it is shared. With potentially non-obvious error messages(could be wrong about that).

Of course, enforcing case-sensitivity across platforms would also fix this, but this might break legacy scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Core This affects CC's core (the Lua runtime, APIs, computer internals). enhancement An extension of a feature or a new feature.
Projects
None yet
Development

No branches or pull requests

5 participants