On Sun, Aug 17, 2003 at 03:12:24AM +0900, Kurt M. Dresner wrote:
> I'm looking through the Ruby documentation and I'm trying to find an
> equivalent to the Python: "pid = os.spawnv(os.P_NOWAIT, program, args)".
> 
> I want to play a sound file in a new process, but I want the ability to
> terminate, stop, and continue this process from the file I am in.
> 
> Any suggestions?

  pid = fork {
    exec(program,*args)
  }

then you can send signals to that particular pid.

Alternatively, if your command is controlled by messages sent on its stdin,
then:

  cmd = IO.popen("program args","w")
  cmd.puts "play"   # or whatever

Regards,

Brian.