specify mode when opening files for reading