DirectoryExists questions
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
copy files with cfdirectory cffile
Hi, I have couple of questions to ask: 1) I can specific copy one file from one folder to another one but I cannot copy all files from my 'dropoff' to my 'gal_o7'. What 's wrong with the code below? 2) I am setting up an event gateway and my CFC will do the copying (I have no CFML). How do I dump out the cfdirectory query? Thanks Here is my code: cfcomponent cffunction name=onAdd cffile action=write file=c:/testlog6.txt output=Here I am back to sssrootasasay CFDIRECTORY Directory= c:/mylocaldir/dropoff NAME=DropoffDir ACTION=List CFTABLE QUERY=DropoffDir HTMLTABLE COLHEADERS CFCOL HEADER=Name TEXT=#Name# CFCOL HEADER=Type TEXT=#Type# CFCOL HEADER=Size TEXT=#Size# /CFTABLE CFLOOP QUERY=DropoffDir CFFILE ACTION=Copy SOURCE=c:\mylocaldir\dropoff\ DESTINATION=c:\gal_07\ NAMECONFLICT=Overwrite /CFLOOP /cffunction /cfcomponent ~| 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:307616 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
copy files with cfdirectory cffile
Hi, I have couple of questions to ask: 1) I can specific copy one file from one folder to another one but I cannot copy all files from my 'dropoff' to my 'gal_o7'. What 's wrong with the code below? 2) I am setting up an event gateway and my CFC will do the copying (I have no CFML). How do I dump out the cfdirectory list? Thanks Here is my code: cfcomponent cffunction name=onAdd cffile action=write file=c:/testlog6.txt output=Here I am back to sssrootasasay CFDIRECTORY Directory= c:/mylocaldir/dropoff NAME=DropoffDir ACTION=List CFTABLE QUERY=DropoffDir HTMLTABLE COLHEADERS CFCOL HEADER=Name TEXT=#Name# CFCOL HEADER=Type TEXT=#Type# CFCOL HEADER=Size TEXT=#Size# /CFTABLE CFLOOP QUERY=DropoffDir CFFILE ACTION=Copy SOURCE=c:\mylocaldir\dropoff\ DESTINATION=c:\gal_07\ NAMECONFLICT=Overwrite /CFLOOP /cffunction /cfcomponent ~| 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:307617 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4