1
使用python的tarfile模塊,有沒有辦法指定tar的Q選項(注意:Haiku具體)的等價物?如何禁用創建硬鏈接
tar --help
-Q, --replace-hardlinks replace hardlinks with corresponding symlink when
extracting
目前的代碼基本上是:
tarFile = tarfile.open(archiveFile, 'r')
members = None
if subdir:
members = [
member for member in tarFile.getmembers()
if member.name.startswith(subdir)
]
tarFile.extractall(targetBaseDir, members)
tarFile.close()