Relying on file handle exceptions is bad and I should feel bad