Module: Process

Defined in:
lib/windows_backport_process_spawn.rb

Class Method Summary collapse

Class Method Details

.spawn(command, args = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/windows_backport_process_spawn.rb', line 4

def self.spawn command, args = {}
  options = {:app_name => command}
  startup_info = {}
  if args[:out]
    startup_info[:stdout] = File.open(args[:out], 'w') # it only accepts descriptors
  end
  options[:startup_info] = startup_info
  a = Process.create options
  a.process_id
  
end