add chmod to Local::write