generalized read/write/clearFile(), added doNotDisplay flag: currently unused