If you are unable to create a new account, please email support@bspsoftware.com

 

FileCopy, no information if sucessful or not?

Started by amichael, 21 Oct 2008 06:33:00 AM

Previous topic - Next topic

amichael

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

jhleonp

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

JoeBoxer

I can vouch for amichael's solution.  its simply a matter of retrieving the status codes from the copy command.