Hi all,
I try to check to see if my directory is already existed so I can rename (the
old directory) before I create one with the same name.
I have two questions:
1) Why does DirectoryExists(curDirectory) return with a 'yes'? when I dont have
one existed.
2) It looked like it renamed and create the folder 'gal' and 'galold' under
c:\Inetpub\wwwroot\projects\testrepo\ at the same time, when I wanted to do was
either rename or create. Seems like it ignores my <cfif> <cfelse> or it loops
through the second time ( and I dont have a loop for that)?
Thanks
<!---this part is to pick up the name of the folder
"c:\localgateway\dropoff\gal" I want to check to see if it is existed in
another place--->
<cfdirectory action = "list" directory = "c:\localgateway" name="DropOffDir"
recurse="true" type="dir" >
<CFLOOP QUERY="DropOffDir">
<cfset DropOffGal = "#DropoffDir.name#" >
</CFLOOP>
<cfset newDir = "#DropOffGal#" & "old">
<cfset curDirectory = "c:\Inetpub\wwwroot\projects\testrepo\" & "#DropOffGal#">
<!--directory 'gal' never existed in c:\Inetpub\wwwroot\projects\testrepo\--->
<!--- Check to see if the Directory exists. --->
<cfif DirectoryExists(curDirectory)>
<cfdirectory action = "rename" directory = "#curDirectory#"
newDirectory = "#newDir#">
<cfelse>
<cfdirectory action = "create" directory = "#curDirectory#" >
</cfif>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308063
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4