Experiencing Problem With ColdFusion's ExpandPath('/') Function

For some strange reason, I've been experiencing a (very weird) problem with the ColdFusion function ExpandPath('/'). I have several web sites on various ColdFusion servers in a shared-host environment. Under normal circumstances, ExpandPath('/') would return the base absolute path for the web site.

For example, if you try using ExpandPath('/') in the default ColdFusion installation, it would most likely return "C:\ColdFusion8\wwwroot\"

However if a site is set up in a multi-instance environment (versus the default installation), ExpandPath('/') should return something similar to: "D:\Inetpub\domainname\"

Where I'm confused is why ExpandPath('/') would return "C:\ColdFusion8\wwwroot\" in a shared-host environment. It just doesn't make sense. Stranger still is if I try ExpandPath('/index.cfm') the shared-host server actually returns the correct response of "D:\Inetpub\domainname\index.cfm"

Why do I care? Well, I would be surprised if I'm the only ColdFusion developer who uses ExpandPath('/') in their programming. I usually store this handy little function in a variable and call it out from time to time in various parts of my applications for those times when I need an "absolute, platform-appropriate path." There are many functions that require the absolute path including the drive, directory, etc.

For now, I've come up with a hack to address this but I would prefer to find out what the cause of the problem is.

Option 1, possibly the easiest to implement, but not as dynamic:


<cfset request.RootDirectory = "D:\Inetpub\domainname\" />

Option 2, easier to replicate throughout multiple sites without have to retype the actual path:


<cfscript>
    request.RootDirectory = expandpath("/index.cfm");
    x = listlen(request.RootDirectory, "\");
    request.RootDirectory = listdeleteat(request.RootDirectory, x, "\");
    request.RootDirectory = request.RootDirectory & "\";
</cfscript>

Obviously, none of these are as easy as what I would prefer to do:


<cfset request.RootDirectory = ExpandPath("/") />

Why is My Browser NOT Supported?

I don't know about you, but whenever I run into a "Browser Not Supported" message, I just start to growl. Here's a screen grab of one I ran into this morning from Eloqua.com.

Um, yeah, here we are, coming into the year 2009 and there are still several companies in the marketplace that throw "Browser Not Supported" messages to the end user. It's not like I'm using some antiquated, or completely custom browser either, I'm using Firefox here. This is not what I call user friendly, especially for a company that tracks user behavior, among other services. I'm quite surprised by this. Am I alone here?

I'm Like'n My Toyota Prius

After crunching the numbers, I finally pulled the trigger and bought a Toyota Prius this week. For the past two years, I've been driving a 4-cylinder 2006 Ford Fusion and have been fairly happy with it. Just to be clear, there was really nothing wrong my Fusion. However, I commute 30+ miles each way from my house to work and back each day.

I was achieving around 26 miles per gallon with the Fusion. Highway mileage was actually closer to 29/30 mpg, but the actual average came in lower. For the most part, I drive the posted speed limits (seriously). This means that my commute on the highway is mostly 65 miles per hour. I noticed a fairly significant difference in my mpg if I drove any faster ... i.e., at 70 (maybe a bit more) mph, my mpg would drop from 29/30 to around 24/25. I think the optimum speed for maximum mpg was in the neighborhood of 55 mph on my Fusion, which would bump my mpg to around 33/34. Not bad, but I do a lot of stop-and-go driving too in the city which, as most of us know, absolutely crush the overall mpg.

As for the numbers, when I looked over my credit card charges for the past several months, I found that I was spending anywhere between $300 to $400 per month on gas! To be fair, that's not just driving to work and back, but still ... those are hard-earned, real dollars going down the tank and out of the exhaust. Granted, it's much better than it would have been if I still had my old Ford Expedition. And yes, I realize that the price at the pump is over $1.00 less per gallon today than it was only a month or so ago, but who truly believes prices will continue falling or even remain flat?

So, I found out that Ruda Toyota in Monroe, WI had a few "slightly used" hybrids on their lot and decided to take a look. After test driving a Prius, I was actually quite surprised at how much I liked it.

The Prius has much more room inside than you might realize. In fact, it seems like the cabin area has more space than the Ford Fusion. The hatch/trunk area is a little smaller than the Ford Fusion, but I really didn't keep much back there anyway other than my baseball glove, some baseballs, a bat and some lawn chairs. If needed, the back seats fold flat which open the entire back of the vehicle giving plenty of room for transporting "stuff." However, with the whole family loaded up, I think we would have to pack carefully for any long trips/vacations.

The Prius rides very nice too. It takes a little getting used to though. For example, I push a button on the dash to start the vehicle and the only way to confirm it's actually "running" is the "Ready" light that appears on the dash. Also, while at a stop light, if the gas engine was running, you might feel/hear it just turn off. Now that's a weird feeling! The pre-hybrid driver in me wants to look for a key to twist and step on the gas pedal, but no fear ... the car is "Ready." When the light turns green, I simply step on the pedal and drive away. I've been told by another Prius driver that driving in the snow is a little different too, so I'll be sure to blog about my experiences as they arise ... which by most accounts could be very soon here in Northern Illinois.

Now when I bought the Prius, I thought I'd be completely satisfied with an average of 40 miles per gallon. I had been hearing people say they get 50 to as much as 60 miles per gallon, but we know how people like to exaggerate, eh? Needless to say, I didn't believe the numbers being thrown around and I needed to see it for myself.

As of my trip to work this morning, my average was 47.8 miles per gallon over the preceding 150 miles. That's over 20 miles per gallon better than I was getting with a 4-cylinder Ford Fusion! Actually, it's almost twice the amount I was used too. Before this morning's trip, I was over 48 miles per gallon, but it was a pretty windy and rainy day which seemed to negatively impact my mpg.

Regardless of the fuel-efficiency, I'm officially a fan of the Toyota Prius. Yes, it was the fuel-efficiency that initially drew me to the Prius, but it was the overall quality of the vehicle that sold me on it. To be sure, nearly cutting my monthly fuel bill in half doesn't hurt either.

© 2026, Stephen J. Withington, Jr.  |  Hosted by Hostek.com

Creative Commons License   |   This work is licensed under a Creative Commons Attribution 3.0 Unported License.