Copy link to clipboard
Copied
Trival problem I'm
sure but I've been going round and round with it...
I'm trying to add an extension to an existing file, but instead of executing the FileMove() function it spits it out as text. I've tried a few variations but I'm not getting anywhere with it.
<cfset fileName = "c:\blahblah">
<cfif FileExits(fileName)>
FileMove("#fileName#","#fileName#.txt")
</cfif>
Try this:
<cfset fileName = "c:\blahblah">
<cfif FileExits(fileName)>
<cfset FileMove("#fileName#","#fileName#.txt") />
</cfif
Copy link to clipboard
Copied
-
Copy link to clipboard
Copied
Try this:
<cfset fileName = "c:\blahblah">
<cfif FileExits(fileName)>
<cfset FileMove("#fileName#","#fileName#.txt") />
</cfif
Copy link to clipboard
Copied
That did the trick!
I never would have thought to use <cfset>...I must have missed that in the documentation.
Copy link to clipboard
Copied
fileMove() is just a function, like any other function. You'd not do this, would you:
<cfoutput>
list2 = listAppend(list1, "foo")
</cfoutput>
?
CF will see anything that is not within a CFML tag or pound-signs as text.
--
Adam