How to read/write characters from/to files.