Updates writeFile to not dispatch each directory it creates.