This should be a member of CFileIO, or a helper function within jfile.cpp (to allow it to be shared by multiple IFileIO implementations).