Blog

Gavin Pickin

May 26, 2022

Spread the word


Share your thoughts

If you are using Windows these days, Windows 10 and 11 give you many of the tools you want and need in the Web Developer Toolbox. After working on Macs and deploying to Linux for a long time, I made the switch back to Windows a while ago, and the list of things that I genuinely miss on Windows is pretty slim, with one major issue, Case Sensitivity or lack of, on Windows.

Why does Case Insensitivity matter?

Windows does not care about the case of files and folders, which is not usually a big deal until you interact with a system that does care, like Linux. If you have fellow developers on Mac or deploy to Linux, this might pop up, be subtle, or be a major issue.

What types of issues does it cause?

If the case of the file on your Windows machine is all uppercase, but the code refers to all lowercase, it will find the file. The file will not be found on a *nix box that is case-sensitive. This means all of your local work and testing will look good, you push it, and now it fails.

But wait CFML isn't case sensitive, or is it?

CFML is usually case insensitive once you get to it, so if the webserver like nginx can get the call to CFML, generally, once you are inside, most things work. Still, things that drop to the system or java will fail since they resort to the system case sensitivity. So, something that does sometimes work might not now. Are you getting a headache? You should be.

Can I just rename my files? On Windows, it's not that easy.

If you have a handler called users.cfc and you rename it Users.cfc, it should solve the problem, right? The issue is that Git on Windows is case insensitive, too, so it doesn't see users.cfc vs. Users.cfc as a change, and you can't commit it. The hack workaround is to rename it to users2.cfc, commit, and then rename to Users.cfc and commit again. How many times will you remember to do that? If you do not do it right, you'll get a situation like in the video below.

What happens when you rename a file on Windows for case without the hack?

If you rename the file from users.cfc to Users.cfc and do not change the case, nothing will happen until you add code and then push. You might get that updating the existing file in Git, or Git might create a second file, Users.cfc, with the new changes as a new file and the old users.cfc exists. When someone else updates Users.cfc, and you pull, will you get users.cfc or Users.cfc, which now can both exist in Git but not on your machine.

This video shows an extreme case caused by case insensitivity and how it can affect your whole team

How do I set my Folders on Windows to be Case Sensitive?

In the next blog in this series, we'll show you how to do it, but, should you do it? This change might not be the silver bullet you think it is, which we'll share as well as we continue this series.

Add Your Comment

Recent Entries

BoxLang 1.0.0 Beta 7 Launched

BoxLang 1.0.0 Beta 7 Launched

We are pleased to announce the release of BoxLang 1.0.0-Beta 7! This latest beta version includes improvements and essential bug fixes, but more importantly it certifies the execution of ColdBox HMVC and TestBox.

What is BoxLang?

BoxLang is a modern dynamic JVM language that can be deployed on multiple runtimes: operating system (Windows/Mac/*nix/Embedded), web server, lambda, iOS, android, web assembly, and more. BoxLang combines many features from different progr

Luis Majano
Luis Majano
July 26, 2024
New BoxLang Feature: Java Method References and Higher-Order Functions

New BoxLang Feature: Java Method References and Higher-Order Functions

We’ve added more goodies to our BoxLang Java interop: method references and higher-order functions. CFML has never let you do these things, making Java Interop feel like a second-class citizen. But with BoxLang, we’re elevating Java integration to a new level.

Maria Jose Herrera
Maria Jose Herrera
July 26, 2024
Level Up Your ColdFusion Skills with our Virtual Live Training: ColdBox from Zero to Hero

Level Up Your ColdFusion Skills with our Virtual Live Training: ColdBox from Zero to Hero

Level Up Your ColdFusion Skills with our Virtual Live Training: ColdBox from Zero to Hero

Are you a CFML developer looking to take your skills to the next level? Look no further than the ColdBox from Zero to Hero Virtual Live Training! This intensive two-day course will equip you with the knowledge and expertise to build robust and scalable applications using ColdBox 7, the latest version of the most popular CFML MVC framework.

What You'll Learn:

  • Master the Fun...

Cristobal Escobar
Cristobal Escobar
July 24, 2024