Thanks again for the help. I did some experimenting. You can't just check for
the existence of the output file, since Xcopy creates that file right away (so
it can stream output data into it). So, I need to test for the presence of the
file *and* some particular string of text within the file itself. I didn't
test Robocopy, since it does not appear to be part of the standard Windows 2000
install, and therefore I'd like to shy away from it. Of course, Xcopy may
still be fundamentally buggy (e.g. fails to copy sometimes), but the following
code seems to work okay. It copied 662MB of data from one folder to another on
the same computer in 95 seconds. The same task using cffile and cfdirectory
would probably take well over an hour.
<cfsetting requesttimeout="600">
<cfset xcopyoutputfile = "d:\xcopyoutputfile.txt">
<cflock name="filecopy">
<cfexecute
name="c:\winnt\system32\xcopy.exe"
arguments="d:\copyfrom\*.* d:\copyto\ /E /Q /Y /I"
outputfile=#xcopyoutputfile#></cfexecute>
<cfset processrunningp = true>
<cfloop condition=#processrunningp#>
<cfif fileexists(xcopyoutputfile)>
<cffile action="read" file=#xcopyoutputfile#
variable="filecontents">
<cfif findnocase("File(s) copied",filecontents)>
<cfset processrunningp = false>
</cfif>
</cfif>
</cfloop>
</cflock>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202790
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54