我们从Python开源项目中,提取了以下8个代码示例,用于说明如何使用tarfile.LENGTH_LINK。
def _calc_size(self, name, link=None): # Initial tar header count = 512 if len(name) > tarfile.LENGTH_NAME: # GNU longname extended header + longname count += 512 count += self._length(name) if link is not None and len(link) > tarfile.LENGTH_LINK: # GNU longlink extended header + longlink count += 512 count += self._length(link) return count