'Opens the file if it\'s not yet open.  This call might fail with
a :exc:`FileError`.  Not handling this error will produce an error
that Click shows.'

def open(self):

    if (self._f is not None):
        return self._f
    try:
        (rv, self.should_close) = open_stream(self.name, self.mode, self.encoding, self.errors, atomic=self.atomic)
    except (IOError, OSError) as e:
        from .exceptions import FileError
        raise FileError(self.name, hint=get_streerror(e))
    self._f = rv
    return rv
