maybeThrowIOExceptionOnOpen