INNER CODE UNIT · Python
__AddLink
DaemonEngine/Daemon · external_deps/cygtar.py:182
def __AddLink(self, tarinfo, linktype, linkpath):
"""Add a Win32 symlink or hardlink to the archive."""
tarinfo.linkname = linkpath
tarinfo.type = linktype
tarinfo.size = 0
self.__AddFile(tarinfo)
def Add(self, filepath, prefix=None):
"""Add path filepath to the archive which may be Native style.
Add files individually recursing on directories. For POSIX we use
tarfile.addfile directly on symlinks and hardlinks. For files, we
must check if they are duplicates which we convert to hardlinks
or Cygwin style symlinks which we convert form a file to a symlink
in the tarfile. All other files are added as a standard file.
"""
# At this point tarinfo.name will contain a POSIX style path regardless