convert error code for stream i/o on replace file call