People: open files in READ_WRITE mode only when necessary. (#5791)