如果中央文件夹中的文件较新,我想更新文件。
这是我到目前为止所拥有的,但随着月份的变化它似乎不起作用 - 几天和几分钟都可以正常工作。
<cfdirectory action="list" directory="#baseViewStackDir#" filter="#viewStackFileName#" name="base_fileInfo">
<!--- end --->
<cfset myViewStackDir = ExpandPath('/designer/app') />
<cfdirectory action="list" directory="#myViewStackDir#" filter="#viewStackFileName#" name="target_fileInfo">
<cfset copy = false />
<cfif DateCompare(base_fileInfo.DATELASTMODIFIED,target_fileInfo.DATELASTMODIFIED,"yyyy") GT 0 >
<cfset copy = true />
<cfelseif DateCompare(base_fileInfo.DATELASTMODIFIED,target_fileInfo.DATELASTMODIFIED,"m") GT 0>
<cfset copy = true />
<cfelseif DateCompare(base_fileInfo.DATELASTMODIFIED,target_fileInfo.DATELASTMODIFIED,"d") GT 0>
<cfset copy = true />
<cfelseif DateCompare(base_fileInfo.DATELASTMODIFIED,target_fileInfo.DATELASTMODIFIED,"h") GT 0>
<cfset copy = true />
<cfelseif DateCompare(base_fileInfo.DATELASTMODIFIED,target_fileInfo.DATELASTMODIFIED,"n") GT 0>
<cfset copy = true />
<cfelseif DateCompare(base_fileInfo.DATELASTMODIFIED,target_fileInfo.DATELASTMODIFIED,"s") GT 0>
<cfset copy = true />
</cfif>
<cfif copy EQ true>
<cffile action="copy" source="#baseViewStackDir##viewStackFileName#" destination="#myViewStackDir#"/>
</cfif>
<script type="text/javascript">
console.log("swf updated=<cfoutput>#copy# #base_fileInfo.DATELASTMODIFIED# - #target_fileInfo.DATELASTMODIFIED# ....#DateCompare(base_fileInfo.DATELASTMODIFIED,target_fileInfo.DATELASTMODIFIED,'m')#</cfoutput>");
</script>
请问谁能发现我的错误?