<?xml version="1.0"?>
<rss version="2.0">
<channel>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<link>http://www.sorcerers-tower.net</link>
<title>Sorcerer&apos;s Tower :: ColdFusion</title>
<description>Welcome to the Tower, my programming and web development blog. Here you will find articles relating to CFML, CSS, HTML, Java, JavaScript and Regular Expressions, plus discussions on the associated tools, technologies, techniques and ideas.&lt;/p&gt; &lt;p&gt;For more general topics, please visit &lt;a href=&quot;http://www.sorcerers-isle.net&quot;&gt;Sorcerer&apos;s Isle&lt;/a&gt;, where you will find articles on my other interests.</description>
<category>ColdFusion</category>
<item>
<title>expandPath bug in CF8</title>
<link>http://www.sorcerers-tower.net/article/expandpath_bug_in_cf8.html</link>
<description>&lt;p&gt;I&apos;ve just encountered a very annoying bug with the expandPath function in CF8.&lt;/p&gt;
&lt;p&gt;Take the following code:&lt;/p&gt;
&lt;code class=&quot;block&quot;&gt;&amp;lt;cfset MyDir = &quot;.&quot;/&gt;
&amp;lt;cfloop index=&quot;i&quot; from=&quot;1&quot; to=&quot;5&quot;&gt;
&amp;lt;cfset MyDir = expandPath(MyDir)/&gt;
&amp;lt;cfoutput&gt;&amp;lt;br/&gt;#MyDir#&amp;lt;/cfoutput&gt;
&amp;lt;/cfloop&gt;&lt;/code&gt;
&lt;p&gt;Run the code through Railo and you will get exactly the right behaviour, with the current directory output five times:&lt;/p&gt;
&lt;code class=&quot;block&quot;&gt;C:\dev\scratch
C:\dev\scratch
C:\dev\scratch
C:\dev\scratch
C:\dev\scratch&lt;/code&gt;
&lt;p&gt;Now go run the same code with CF8 - and this is what you get:&lt;/p&gt;
&lt;code class=&quot;block&quot;&gt;F:\ColdFusion8\wwwroot\scratch
F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch
F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch
F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch
F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch&lt;/code&gt;
&lt;p&gt;It simply stacks the current directory onto the front each time. Very frustrating.&lt;/p&gt;
&lt;br/&gt;
&lt;p&gt;In order to get round this, I created a regular expression to pull off the last value of any directory containing more than one colon - this will work for Windows machines, but may need to be changed for Linux or MacOSX machines (if the bug affects these).&lt;/p&gt;
&lt;code class=&quot;block&quot;&gt;&amp;lt;cfif isDefined(&apos;Server.ColdFusion.ProductName&apos;)
AND Server.ColdFusion.ProductName EQ &apos;ColdFusion Server&apos;
AND ListLen( MyDir ,&apos;:&apos;) GT 2&gt;
&amp;lt;cfset MyDir = REreplace( MyDir , &quot;^.*([A-Z]:[^:]+)$&quot; , &quot;\1&quot; )/&gt;
&amp;lt;/cfif&gt;&lt;/code&gt;</description>
<pubDate>Sat, 16 Aug 2008 17:23:42 GMT</pubDate>
</item>
<item>
<title>CFML Engine Comparison</title>
<link>http://www.sorcerers-tower.net/article/cfml_engine_comparison.html</link>
<description>&lt;p&gt;I have just published the &lt;a href=&quot;http://www.cfml-engines.info&quot;&gt;CFML Engine Wiki&lt;/a&gt;, a website to compare and detail the features and differences of the top CFML engines.&lt;/p&gt;
&lt;p&gt;There is still a lot of work to be done with it, but with it being a wiki I decided it better to release the URL and allow others to help with doing that.&lt;/p&gt;
&lt;a class=&quot;c&quot; href=&quot;http://www.cfml-engines.info&quot;&gt;www.cfml-engines.info&lt;/a&gt;</description>
<pubDate>Mon, 02 Jun 2008 09:07:15 GMT</pubDate>
</item>
</channel>
</rss>
