Hi,
I'm working with decisionStream for some years, sometimes (and only sometimes) it drives me crazy:
within a Job I need to copy some files.
Until now, I did this with a System-Call:
System( 'copy c:\tmp\start.txt c:\Newfile.txt /y /V' )
unfortunately, there's no chance to see whether the copy was correct finished or aborted due to network trouble for example.
How can I get something like an error-code for the result of the Filecopy?
the same problem occurs for moving files or deleting them, which is also done with the help of system calls.
Regards, Andy
Hi...
I´m using w2003 Server and i hade the same problem with xp pro and copy statement.
In w2003 Server ôm using this, hope is usefull 4 u.
----------------------------------
Declare "res" as integer
$res := System('copy d:\hr.dat d:\temp /Y /v');
Return $res = 0 ;
------------------------------------
XCOPY:
0 success
1 no files found to copy
2 aborted by ^C
4 initialization error (not enough memory or disk space, invalid drive, or syntax error)
5 disk write error
I can vouch for amichael's solution. its simply a matter of retrieving the status codes from the copy command.