Linux and Application.cfc

I've been having lots of fun playing around with my shiny new Linux (Ubuntu) installation. However, for someone that's been used to the easy life under Window$ I have to admit that there is a little of a learning curve. One of the things that's been causing me the most grief (right after all that hacking in the terminal) is the fact that Linux is case-sensitive. As a ColdFusion developer, that means I have to be extra careful about how I name and call my pages.

This means that if I have an index.cfm file, I can't link to it with Index.cfm. Or INDEX.cfm. Or even index.CFM. You get the picture. The thing is, though, that ColdFusion gives special meaning to certain file names. Earlier today, I was starting a new mini-project, the first since my Linux install. I create my application.cfc file, put some methods in there, initialize a couple of variables. I then try outputting them to the browser in some random .cfm page, just for kicks. To my surprise, nothing that I had done in my application.cfc seemed to have been run. This had me stumped for a good 10 seconds (Yeah, I'm that good. Ok, Ok, I'd remembered reading about it a while back.). For some reason, and this has been hanging around for a while now, when the Linux version of ColdFusion was first compiled the file's name was specified as Application.cfc. Other files to be careful about are OnRequestEnd.cfm and Application.cfm

From what I was able to test, cfincludes also suffer from this case-sensitivity, although cfmodule, cfimport and calling custom tags via cf_ seem impervious.

TweetBacks
There are no TweetBacks for this entry.
Comments
ike's Gravatar One of the most popular entries on my blog: http://ontap.riaforge.org/blog/index.cfm/2007/12/2...
# Posted By ike | 11/2/08 7:07 PM
Sam Nicholson's Gravatar I had the same problem when I first started working with Linux. All of our development is done on windows networks but staging and production are Linux. In some ways it is quite good because it has enforced us to name files better but is still pain when new developers start working with us and we have to get them in the habit of writing their links, locations etc to match the exact case of the file and path.
# Posted By Sam Nicholson | 11/3/08 7:42 AM
Francois Levesque's Gravatar @ike,

I get what you mean. I'm just trying to imagine distro X saying:

"OK guys, we're rolling out a case-insensitive filesystem in the next version. You've got 6 months to go through all your files and eliminate/rename duplicate files, and make sure you call the right ones now."

@Sam,

I guess it just takes some getting used to. I like your comment about "naming files better". I agree with ike as to not having any (significant) performance gains, but why would you have to name your files different ways? Settle for a standard and let everyone know about it. That way you're sure it'll work on either OS.
# Posted By Francois Levesque | 11/3/08 9:30 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.3.000. Contact Blog Owner