fix read and write. eet : don't mix stream and file