I can approach this in the wrong direction, so any help would be appreciated.
I have a Ruby script that, among other things, runs an executable file. I want to run this executable file - it is currently launched using the system "", and then continue to work with the script. When the script ends, I want it to exit, but leave the executable file running.
I originally had the following
# Do some work
But executable_to_run.exe is an executable lock file, and the system "" will not be completed until the executable completes execution (which I do not want)
So now I have something like this (abbreviated)
# Do some work
This works well, as my script can continue to work while the thread runs the executable in the background. Unfortunately, when my script comes to the exit, the executable thread is still working, and it will not exit until the thread can exit. If I kill the executable, the thread will end and the script will exit.
So what I need to do is run "executable_to_run.exe" and just leave it in the background.
I am using Ruby 1.8.7 on Windows, which means fork is not implemented. I cannot upgrade to 1.9, because there are internal and external dependencies of the commands that I need to resolve first (and which will not be executed in the near future).
I tried
- Starting the process through the "start", but it still blocks
- Calling Thread.kill on the executable thread but it still requires the executable to be killed
So this is what I can do in Ruby and I just missed something or am I having a problem because I cannot use Fork?
Thanks in advance
source share