The _open function takes some form of file identifier and creates
        an :py:class:`CpioFile` instance from it.

        :param :py:class:`str` name: a file name
        :param :py:class:`file` fileobj: if given, this overrides *name*
        :param :py:class:`mmap.mmap` mymap: if given, this overrides *fileobj*
        :param :py:class:`bytes` block: file contents in a block of memory, (if given, this overrides *mymap*)

        The file to be used can be specified in any of four different
        forms, (in reverse precedence):

        #. a file name
        #. :py:class:`file` object
        #. :py:mod:`mmap.mmap`, or
        #. a block of memory

def _open(self, name=None, fileobj=None, mymap=None, block=None):
        """
        The _open function takes some form of file identifier and creates
        an :py:class:`CpioFile` instance from it.

        :param :py:class:`str` name: a file name
        :param :py:class:`file` fileobj: if given, this overrides *name*
        :param :py:class:`mmap.mmap` mymap: if given, this overrides *fileobj*
        :param :py:class:`bytes` block: file contents in a block of memory, (if given, this overrides *mymap*)

        The file to be used can be specified in any of four different
        forms, (in reverse precedence):

        #. a file name
        #. :py:class:`file` object
        #. :py:mod:`mmap.mmap`, or
        #. a block of memory
        """

        if block is not None:
            if not name:
                name = '<unknown>'

            self.unpack_from(block)

            if fileobj:
                fileobj.close()

            return self

        if mymap is not None:
            block = mymap

        elif fileobj:
            try:
                mymap = mmap.mmap(fileobj.fileno(), 0,
                                  mmap.MAP_SHARED, mmap.PROT_READ)

            # pylint: disable=W0702
            except:
                mymap = 0
                block = fileobj.read()

        elif name:
            fileobj = io.open(os.path.normpath(os.path.expanduser(name)), 'rb')

        else:
            assert False

        return self._open(name=name,
                         fileobj=fileobj,
                         mymap=mymap,
                         block=block)