'Add the file `name\' to the archive. `name\' may be any type of file
(directory, fifo, symbolic link, etc.). If given, `arcname\'
specifies an alternative name for the file in the archive.
Directories are added recursively by default. This can be avoided by
setting `recursive\' to False. `exclude\' is a function that should
return True for each filename to be excluded. `filter\' is a function
that expects a TarInfo object argument and returns the changed
TarInfo object, if it returns None the TarInfo object will be
excluded from the archive.'

def add(self, name, arcname=None, recursive=True, exclude=None, filter=None):

    self._check('aw')
    if (arcname is None):
        arcname = name
    if (exclude is not None):
        import warnings
        warnings.warn('use    the    filter    argument    instead', DeprecationWarning, 2)
        if exclude(name):
            self._dbg(2, ('tarfile:    Excluded    %r' % name))
            return
    if ((self.name is not None) and (os.path.abspath(name) == self.name)):
        self._dbg(2, ('tarfile:    Skipped    %r' % name))
        return
    self._dbg(1, name)
    tarinfo = self.gettarinfo(name, arcname)
    if (tarinfo is None):
        self._dbg(1, ('tarfile:    Unsupported    type    %r' % name))
        return
    if (filter is not None):
        tarinfo = filter(tarinfo)
        if (tarinfo is None):
            self._dbg(2, ('tarfile:    Excluded    %r' % name))
            return
    if tarinfo.isreg():
        f = bltn_open(name, 'rb')
        self.addfile(tarinfo, f)
        f.close()
    elif tarinfo.isdir():
        self.addfile(tarinfo)
        if recursive:
            for f in os.listdir(name):
                self.add(os.path.join(name, f), os.path.join(arcname, f), recursive, exclude, filter)
    else:
        self.addfile(tarinfo)
