We have a simple script that copies files across from a base install folder we created to house files for our application. When we choose to install a new site, based on these files, it's saying that the destination directory can't be found.
<cfset variables.destination = "#variables.base_path#\#variables.destination#\wwwroot\">
<!--- actually copying the base installation to the new location--->
<cfdirectory action="copy" directory="#mycontent.directory#\#mycontent.name#" destination="#variables.destination#" recurse="yes" >
<!--- end copying the system files --->
The wwwroot directory will always exist on the system. We are trying to push files into that folder. However it's throwing an error and won't allow it to go through.
The actual error message being caught is:
The specified directory C:\home\domainname.com\wwwroot\ could not be created. The most likely cause of this error is that C:\home\domainname.com\wwwroot\ already exists on your file system.
I tried the following in ColdFusion 11:
This works fine, whether the folder has been previously created or not. Also, it seems that the recurse attribute is supported, despite the documentation only stating that it is valid for list and delete actions.
https://wikidocs.adobe.com/wiki/display/coldfusionen/cfdirectory
As it seems to happen some times but not others perhaps it is a timing issue or with large files / multiple folders?