This is one case where I think Windows is appropriately designed for its target audience.
I don’t really see the benefit of allowing users to create files with the same name in the same directory, yeah, yeah I know that case sensitivity means that it isn’t same name, but imagine talking to a user, guiding them to open the file /tmp/doc/File and they open /tmp/doc/file instead
The reason, I suspect, is fundamentally because there’s no relationship between the uppercase and lowercase characters unless someone goes out of their way to create it. That requires that the filesystem contain knowledge of the alphabet, which might work if all you wanted was to handle ASCII in American English, but isn’t good for a system which needs to support the whole world.
In fact, the UNIX filesystem isn’t ASCII. It’s also not unicode. UNIX uses arbitrary byte strings, with special significance given to a very small number of bytes (just ‘/’ and ‘\0’, I think). That means people are free to label files in whatever way they like, and their terminals or other applications are free to render them in whatever way seems appropriate, without the filesystem having to understand unicode.
Adding case insensitivity would therefore actually be significant and unnecessary complexity to add to the filesystem drivers, and we’d probably take a big step backwards in support for other languages
pov: you encode filenames in utf-1, just happens to contain one of those bytes
Let’s say you have a software that generates randomly named files, having the ability to use both upper case and lower case means you can have more files with the same amount of characters, but that sounds horrible and it’s the only thing I can think of atm
macOS also does this by default, but you can change it (though you have to reformat the disk in question). This is generally fine for non-system disks if you REALLY need it for some reason, but afaik it is not recommended for the OS disk due to assumptions that macOS-targeted binaries make (similar to the windows regex version matching that caused problems for a while because it became the unofficial best way to check windows versions for app install compatibility). It’s doubly annoying on newer Apple systems because the integrated SSDs are WAY faster than pretty much anything else you can connect to it. But for the most part, I find it’s more of a nuisance to keep in mind than a real problem (I’ve been dealing with dev-issue MBPs since about 2012).
As in the windows case, this is also an appropriate choice for the average Apple user (though the fact that they’re fairly ubiquitous as dev machines in many places is annoying on several levels, despite the generally solid best-case performance and thermals I’ve observed).
Huh I had thought case-sensitive was default on APFS/HPFS and you had to choose insensitive specifically but I guess not
Just checked on my work box - if you go into Disk Utility and start the process to add a volume, the default selection is
APFS
, and there’s an option in the dropdown for forAPFS (Case-sensitive)
This isn’t “Windows design”… this is just inherited stone age bullshit from the DOS days when the filesystem was FAT16 and all file names were uppercase 8.3.
NTFS is case sensitive in its underlying design, but was made case insensitive by default, yet case preserving, for reasons of backwards compatibility.
If Microsoft has to design something from scratch, without the need for backwards compatibility, they go for case sensitive themselves. For example: Azure Blob Storage has case sensitive file names.
If you rename a file only changing the casing it doesn’t update properly, you need to rename it to something else and back.
This is so userfriendly I have been stumped by it multiple times.On the other hand in using Linux I have had a number of problems with the casing of files: The number is 0
If you rename a file only changing the casing it doesn’t update properly, you need to rename it to something else and back. This is so userfriendly I have been stumped by it multiple times.
To my great surprise, this has been fixed. I don’t know when, but I tried it on my Windows 10 VM and it just worked. Only took them 20 years or so :)
case insensitive by default, yet case preserving
This isn’t just a Windows thing… It’s the same on MacOS by default.
It’s neat that Linux has the ability to do this, but I honestly can’t think of a good usecase for this. I think this is more confusing than it is useful
Git likes to have a word with you.
Command ‘Git’ not found
Beautiful
Huh, what makes this a use case in favor of case sensitive file names? How does git use this feature?
Create multiple branches that only differ in cases from a Unix OS so it breaks git for Windows users in the same project.
I feel the same way about programming languages. There is no way that “User” and “user” should refer to different variables. How many times has that screwed people up, especially in a weekly typed language?
One of the many things that I feel modern versions of Pascal got right.
Windows and NTFS support case sensitive filenames. The functionality is disabled for compatibility reasons.
cd downloads
bash: cd: downloads: No such file or directory
cd Downloads
user@pcname:~/Downloads$
Bash has an option for that you can put in your
.bashrc
:bind "set completion-ignore-case on"
I can make a file named COM1 on Linux. That’s on the forbidden list for Windows.
The forbidden list:
- CON
- PRN
- AUX
- CLOCK$
- NUL
- COM1
- COM2
- COM3
- COM4
- COM5
- COM6
- COM7
- COM8
- COM9
- LPT1
- LPT2
- LPT3
- LPT4
- LPT5
- LPT6
- LPT7
- LPT8
- LPT9
That’s because Windows is generally very backwards compatible.
So is Linux, but it puts stuff like that in /dev
The thing is, a lot of the legacy backwards compatible stuff that’s in Linux is because a lot of things in Unix were actually pretty well thought out from the get go, unlike many of the ugly hacks that went into MSDOS and later Windows and overstayed their welcome.
Things like: long case sensitive file names from the beginning instead of forced uppercase 8.3 , a hierarchical filesystem instead of drive letters, “everything is a file” concept, a notion of multiple users and permissions, pre-emptive multitasking, proper virtual memory management instead of a “640k is enough” + XMS + EMS, and so on.
It still amazes me how well thought out unix was for the era when computing was in its infancy. But I guess that is what you get with computer science nerds from Universities and a budget for development based on making a product the goal, not quarterly profit the goal.
It’s what you get when you design an OS for a mainframe computer that is accessed by many users sharing its resources.
DOS was designed for single-user PC’s with very limited processing power, memory and storage, and no access to networked drives. Lots of its hacks and limitations saved a few hundred bytes of memory, which was crucial at the time.
And i hate it being case sensitive
Yeah, right? Are we pretending that having case sensitive file names isn’t a bad call, or…? There are literally no upsides to it. Is that the joke?
I’m with you here, i find it infuriating and i never ever had the situation where this was beneficial.
Like who tf actually creates a File.txt, file.txt AND FILE.TXT in one place and actually differentiates them with that.
I mean, it’s less of an issue on Linux for both design and user profile reasons, but imagine a world where somebody can send all the normie Windows users a file called Chromesetup.exe to sit alongside ChromeSetup.exe. Your grandma would never stop calling you to ask why her computer stopped working, ever.
Who sends setup binaries? I would tell my grandma to install it from the repository.
thank god it’s not case sensitive holy shit. i don’t understand the kind of person who would see that as a positive.
Seriously.
It sounds like a fucking nightmare. Imagine working on something for days and it refuses to work cause you accidentally capitalized 1 file name and dont notice it?
That sounds like the kind of shit they’d do in tech hell.
We regularly have that problem at work. Works on your development PC on Windows. Push to pipeline, get cryptic error messages. Once we were two people trying to figure it out for half an hour.
Case-sensitive file names. Why.
Thought experiment: Would you expect a programming language variable name to be case insensitive?
That is, if you set
foo = 1
and thenprint FOO
, what should happen? Most programming languages throw an error.Is this even comparable with filenames, which are, after all, basically variable names that hold large quantities of data?
If there is a difference, is it the fact it’s a file, or - for a mad idea - should files with only a few bytes of data retain case insensitivity? And if that idea is followed through, where’s the cutoff? 256 bytes? 7?
(Anyway, Windows filenames are case sensitive, in a sense. If you save “Letter to Grandma.txt” it will retain those two capital letters and all the lower case letters exactly as they are. It won’t suddenly change to “LETTER to Grandma.txt”, despite the fact that if you try to open a file by that name, you’ll get the same file.)
PowerShell variable names and function names are not case sensitive.
I understand the conventions of using capitalization of those names having specific meanings in regards to things like constants, but the overwhelming majority of us all use IDEs now with autocomplete.
Personally, I prefer to use prefixes anyway to denote that info. Works better with segmenting stuff for autocomplete, and has less overhead of deriving non-explicit meaning from stuff like formatting or capitalization choices.
On top of that, you really shouldn’t be using variables with the same name but different capitalization in the same sections of code anyway. “Did I mean to use $AGE, $Age, or $age here?” God forbid someone come through to enforce standards or something and fuck that all up.
But should $Age return the same value as $age if used in its place by mistake?
you really shouldn’t be using variables with the same name but different capitalization in the same sections of code anyway.
It’s a standard convention. Notice step #3 here: https://scottlilly.com/learn-c-by-building-a-simple-rpg-index/lesson-08-1-setting-properties-with-a-class-constructor/
Edit: Step #4 is a different standard convention that also applies here.
But why though? Do you really want a bunch of file.txt File.txt FILE.txt fIle.txt FiLe.txt FIle.txt flIe.txt… I once had a nasty bug the O in a file name was a 0 and I didn’t notice I can’t imagine the horrors this would cause.
Yeah I’ve definitely run into issues where case sensitivity causes problems. Especially in programs that are cross-functional between Windows and Linux. Like when I recently downloaded some bios files for a Playstation emulator and I spend time figuring out and troubleshooting why they weren’t working until it finally hit me the door McFly it’s cause the file name was in lowercase not uppercase. Than I cared to admit to figure out
Oooh, I’ve had that with some device. I think it was a camera or something like that. I’d forgotten about it. It took me ages to figure it out.
Windows way is superior, in my opinion. I don’t think there’s a need for File.txt and fILE.txt
I don’t think there’s a need for File.txt and fILE.txt
It’s not so much about that need. It’s about it being programmatically correct.
f
andF
are not the same ASCII or UTF-8 character, so why would a file system treat them the same?Having a direct
char
type to filename mapping, without unnecessary hocus pocus in between, is the simple and elegant solution.It turns out that the easiest thing to program isn’t always the best application design.
surely Git warns about stuff like this when you clone it, right ?
It tells you there’s a name clash, and then it clones it anyway and you end up with the contents of
README.MD
inREADME.md
as an unstaged change.sounds like actually a good solution … tho doesnt sound like it would work for more than 2 similarly-named files
I don’t think it’s intended as a “solution”, it just lets the clobbering that is caused by the case insensitiveness happen.
So git just goes:
- checkout content of README.md to README.md (OS creates README.md)
- checkout content of README.MD to README.MD (OS overwrites README.md)
If you add a third or fourth file … it would just continue, and file gets checked out first gets the filename and whichever file gets checked out last, gets the content.
I sometimes run into this when I extract an archive file on Windows and there are files named with different cases but are otherwise the same. I prefer case-sensitivity because I like precision and fewer assumptions being made about a system and how it’s used.
You can make windows care about file case sensitivity. We enable it at work to ensure sanity with our local git repo’s. https://www.ortussolutions.com/blog/how-to-make-windows-folders-case-sensitive