in reply to How would you catch this error?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How would you catch this error?
by LanceDeeply (Chaplain) on May 09, 2003 at 18:06 UTC |