Saves the content of file named ``name`` to ``filename``.

           Works like :meth:`get_stream`, but ``filename`` is the name of
           a file which will be created (or overwritten).

           Returns the full versioned name of the retrieved file.

def get_file(self, name, filename):
        """Saves the content of file named ``name`` to ``filename``.

           Works like :meth:`get_stream`, but ``filename`` is the name of
           a file which will be created (or overwritten).

           Returns the full versioned name of the retrieved file.
        """
        stream, vname = self.get_stream(name)
        path, version = split_name(vname)

        dir_path = os.path.dirname(filename)
        if dir_path:
            mkdir(dir_path)

        with open(filename, 'wb') as f:
            shutil.copyfileobj(stream, f)

        return vname