One way would be to redirect the output from the command line and capture it. Take a look at IPC::Open3 as a substitute for using open. It allows you to capture STDOUT and STDERR to different streams. Assuming that the exe in question does something as sensible as issuing the errors on a different handle to the normal output.
Perhaps easier, although it does a leave a window of opportunity for error, would be to check the status of the file before issuing the command. You might need to use sysopen or Win32API::File::createFile with the appropriate set of share attributes to detect of the file is already in use before you issue the command.
In reply to Re: How would you catch this error?
by BrowserUk
in thread How would you catch this error?
by LanceDeeply
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |