CleverHanz has asked for the wisdom of the Perl Monks concerning the following question:
I am on windows server 2003. I have a bat file that is used at start up to run a java applet that sits on the machine and monitors a file for changes.
Lets say that StartJava.bat calls the command :
start /min d\java\jdk\1.4\bin\java -classpath d:\java\Thingy.jar Thingy d:\Thingything.dat
And Thingy.jar sits open in a command prompt and monitors a file.
I decided that it would be handy to have this java app started by a perl script instead of a bat file, so I could add some functionality to the startup script as well as better error handling. So now I have:
perl StartJava.pl
It works, and the app runs fine, however, when I start the java applet with perl the perl script gets locked and cannot be changed until the java applet is closed.
The thing is that when I run the bat file to start the java applet I can make changes to the bat file that started it.
This happens even if I Have StartJave.pl call the orriginal StarJava.bat which in turn calls the jar file and the StartJava.bat file closes.
Seems like perl still realizes that somewhere down the line the java app is still running. And won't let me rename or change StartJava.pl. Even though the perl process and the cmd prompt which started it have both closed.
I read some docs on perl process creation that perl passes pointers or some such to child processes back to the parents STDERR and STDOUT
I have tries several things to get perl to let go, but nothing works.
I tried using exec (StartJava.bat), I tried system(1, $cmd) I tried Win32::Process::Create()
Any ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl file handles
by ikegami (Patriarch) on Mar 06, 2009 at 18:32 UTC | |
by Anonymous Monk on Mar 06, 2009 at 19:01 UTC | |
by ikegami (Patriarch) on Mar 06, 2009 at 19:04 UTC | |
by CleverHanz (Novice) on Mar 06, 2009 at 20:29 UTC | |
by ikegami (Patriarch) on Mar 06, 2009 at 21:09 UTC | |
|
Re: Perl file handles
by Marshall (Canon) on Mar 06, 2009 at 21:25 UTC |