 
   START_CHAR = String.fromCharCode(1)
   END_CHAR = String.fromCharCode(4)
+  STOP_CHAR = String.fromCharCode(0)
 
   emitStart = ->
     process.stdout.write(START_CHAR+'\n')


  START_CHAR = String.fromCharCode(1)
  END_CHAR = String.fromCharCode(4)

  scanTask = makeTask(multiProcessScan)
  searchTask = makeTask(multiProcessSearch)

    data = readLine(process.stdin)
    return unless data

    emitStart()
    if data[0] == STOP_CHAR
      emitEnd()
    else
      paths = JSON.parse(data)
      searcher.searchPaths regex, paths, (results) ->
        emitResults(results)

multiProcessSearchMain = (options) ->
  options.pathToScan = path.resolve(options.pathToScan)
