 try
   fs.mkdirSync __dirname+"/.tmp/"
 catch e
-
 
 flipped = (fn) -> -> fn.apply this, [ arguments... ].reverse()
 

      # @workerProcess[name].stopReporter() #TODO think about it
      @kill name

  populateChildObject: (options, @child) ->
    { name, onMessage, modulePath, args, restart, restartTimeout, cmd, log,
      onExit, stdout, stderr, verbose, die } = options
    onExit ?= ->
    console.log "[PROCESSES][#{name}] started the process: #{name} with pid: #{@child.pid}"  if verbose
    @createPidFile @child.pid, name

    childObj =
      name    : name
      process : @child
      pid     : @child.pid
      verbose : verbose

    if cmd
      childObj.cmd = cmd

        console.log "[PROCESSES][#{name}]it's time you die process:#{name}"  if verbose
        @kill name

    child.on 'exit', =>
      console.log "[PROCESSES][#{name}] observing a process exiting", child.pid
      console.log "[PROCESSES][#{name}] did exit."  if verbose
      @emit "exit", child.pid, name
      delete @list[name]
      if options.kontrol?.enabled
        workerProc.stopReporter "ack"
        workerProc.stopReporter "add"
        workerProc.connection.end()
        delete @workerProcess[name]  if @workerProcess[name] is workerProc

    child.on 'close', =>
      console.log "[PROCESSES][#{name}] did close."  if verbose
      @emit "close", child.pid, name
      onExit child.pid, name
      if @disableRestart is yes
        console.log "[PROCESSES][#{name}] restart is disabled because of force mode."  if verbose
        @disableRestart = no
