def add(self, name, arcname=None, recursive=True, exclude=None, filter=None):
self._check("<STR_LIT>")<EOL>if arcname is None:<EOL><INDENT>arcname = name<EOL><DEDENT>if exclude is not None:<EOL><INDENT>import warnings<EOL>warnings.warn("<STR_LIT>",<EOL>DeprecationWarning, <NUM_LIT:2>)<EOL>if exclude(name):<EOL><INDENT>self._dbg(<NUM_LIT:2>, "<STR_LIT>" % name)<EOL>return<EOL><DEDENT><DEDENT>if self.name is not None and os.path.abspath(name) == self.name:<EOL><INDENT>self._dbg(<NUM_LIT:2>, "<STR_LIT>" % name)<EOL>return<EOL><DEDENT>self._dbg(<NUM_LIT:1>, name)<EOL>tarinfo = self.gettarinfo(name, arcname)<EOL>if tarinfo is None:<EOL><INDENT>self._dbg(<NUM_LIT:1>, "<STR_LIT>" % name)<EOL>return<EOL><DEDENT>if filter is not None:<EOL><INDENT>tarinfo = filter(tarinfo)<EOL>if tarinfo is None:<EOL><INDENT>self._dbg(<NUM_LIT:2>, "<STR_LIT>" % name)<EOL>return<EOL><DEDENT><DEDENT>if tarinfo.isreg():<EOL><INDENT>f = bltn_open(name, "<STR_LIT:rb>")<EOL>self.addfile(tarinfo, f)<EOL>f.close()<EOL><DEDENT>elif tarinfo.isdir():<EOL><INDENT>self.addfile(tarinfo)<EOL>if recursive:<EOL><INDENT>for f in os.listdir(name):<EOL><INDENT>self.add(os.path.join(name, f), os.path.join(arcname, f),<EOL>recursive, exclude, filter=filter)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>self.addfile(tarinfo)<EOL><DEDENT>
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.