1

我们有一个简单的脚本,它从我们创建的基本安装文件夹复制文件,以存放我们的应用程序的文件。当我们选择安装一个新站点时,根据这些文件,就是说找不到目标目录。

<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 ---> 

wwwroot目录将始终存在于系统中。我们正在尝试将文件推送到该文件夹​​中。但是它会引发错误并且不允许它通过。

被捕获的实际错误消息是:

无法创建指定的目录 C:\home\domainname.com\wwwroot\。此错误的最可能原因是 C:\home\domainname.com\wwwroot\ 已存在于您的文件系统上。

4

1 回答 1

0

我在 ColdFusion 11 中尝试了以下操作:

<cfdirectory directory="//users/myname/sites/test/source"
    destination="//users/myname/sites/test/dest"
    action="copy" recurse="yes">

这工作正常,无论该文件夹之前是否已创建。此外,似乎支持 recurse 属性,尽管文档仅说明它对列表和删除操作有效。

https://wikidocs.adobe.com/wiki/display/coldfusionen/cfdirectory

似乎有时会发生,但有时不会发生,这可能是时间问题还是大文件/多个文件夹?

于 2014-05-15T21:28:43.827 回答