Write dirs in 0777.