writeFile now uses cb pattern