File read/write access for text and binary