file lock during exec() use
Hi, thanks for your attention.
I'm having the following problem: (using Java 6 and Windows XP)
I want to open an image tools from my java program, using an image file already existing, during my java program execution.
But when I try to save the edited image on the same file, the image tool cannot do it, apparently because of a file write lock on the original file.
I do not keep any lock or stream open on the file (dont even open the file), and the problem does not happen every time. Can anybody tell my if this is a normal behaviour, and a possible workaround if it exists?
Here is my code
// ....
java.io.File executable ="c:/windows/system32/mspaint";
String order =executable.getAbsolutePath() + c:/temp/image1.jpg";
Process proc= Runtime.getRuntime().exec(order,
null,executable.getParentFile());
proc.waitFor();
// ....

