Strange return from command EXT

User discussion and information resource forum for the TeraByte OS Deployment Tool Suite.
Post Reply
ostapvoip
Posts: 58
Joined: Fri Feb 08, 2013 10:32 pm

Strange return from command EXT

Post by ostapvoip »

Hi,

This code always returns retcopy=0 https://i.imgur.com/t0RqnlM.png

sub main()
// ext ("SET OPTION QUIET 1")
printl ("copy file ^"C:\tools\tetris.exe^" ^"C:\tools\tetris2.exe^" -yq")
retcopy = ext ("copy file ^"C:\tools\tetris.exe^" ^"C:\tools\tetris2.exe^" -yq")
printl (retcopy)
// ext ("SET OPTION QUIET 0")
end sub
Eric
Posts: 209
Joined: Mon Sep 05, 2011 6:53 pm
Location: France

Re: Strange return from command EXT

Post by Eric »

Well, yes, if the source does not exist, it cannot copy, and thus, there is no failure in the copy process. The point is that there may be situations where you want it to return an error, and others where you want it to return a success (because you only want to trap real failure). In the first case, you can add a findfirst() code before copying to ensure the file exists.
That's the same with the "del file" command: if the file to delete does not exist, it also return a success...
ostapvoip
Posts: 58
Joined: Fri Feb 08, 2013 10:32 pm

Re: Strange return from command EXT

Post by ostapvoip »

Hmm..
This is a bit out of the box.
But as an option it has the right to life. For some reason, such options are not considered in the documentation.
There are even no return options (and they certainly are).
It would be nice to include code examples there.
Post Reply