I wonder whether mode should be passed to CFileIO constructor, or something like that instead.