detecting a file has finished copying (using xcopy)
Hi I have a unique problem here. My program writes a batch file, which in turn uses xcopy to copy particular files to remote machines. In addition, the remote machines will run the files which are copied.
Now my question is how am I able to find out (on the cilent side) my file has finished coping using the xcopy. Use file exists or find the length (size) of the file?
Heres a snippet of the pseudo code:
Server
if (send button is press)
open batch filefor writing commands
xcopy ..\test.exe
xcopy ..\test2.exe
endif
Cilent:
if(xcopy is finished)
execute test.exe
execute test2.exe
endif
Many thanks
Message was edited by:
Zsefv
[910 byte] By [
Zsefva] at [2007-11-27 8:51:01]

@pbulgarelli
my question is how do i know when the copying is finished...
@mkoryak
Java's socket copying not very reliable. I do not know why sometimes a byte is lost and do not wish to spend time debugging it.
@BigDaddyLoveHandles
I dont think i want to delete the file after copying...
@Danniel_Willian
I do not think that thread helps much... I have googled for it and this is another thread which may be of use i hope
http://forum.java.sun.com/thread.jspa?threadID=423493&messageID=1886835
Zsefva at 2007-7-12 21:03:28 >

> @pbulgarelli
> my question is how do i know when the copying is
> finished...
Process proc = Runtime.getRuntime().exec("xcopy ......");
proc.waitFor(); // WAIT UNTIL XCOPY FINISH
//AT THIS POINT THE XCOPY FINISHED AND YOU CAN SEND A MESSAGE TO YOUR CLIENT...
> @mkoryak
> Java's socket copying not very reliable. I do not
> know why sometimes a byte is lost and do not wish to
> spend time debugging it.
Are u insane ? hehehehe
the Sockets works well, and its easy to use.
Did I help this time?
cya