   end
 end
 
-to_processes = [ "./", "./", "./", "./", "./", "./", "./" ]
+to_processes = File.ls!("./") |> Enum.reject(&(File.dir?(&1)))
 
 Enum.each 1..10, fn num_processes ->
   {time, result} = :timer.tc(

  def count(scheduler) do
    send scheduler, { :ready, self()}
    receive do
      { :count, dir, client } ->
        send client, { :answer, dir, count_seek(dir), self() }
        count(scheduler)

      { :shutdown } ->

    |> Enum.map(fn list -> Enum.filter(list, &(&1 == "do")) end) # 入れ子になるので外側の無名関数はは&1使えない
    |> Enum.map(&(Enum.count(&1)))
  end
  # Twitterで教えてもらったもっとスマートな回答。
  # for x <- File.ls!(dir), !File.dir?(x), do: File.read!(x) |> String.split() |> Enum.filter(&(&1 == "do")) |> Enum.count(&(&1))
end

defmodule Scheduler do
