【发布时间】:2011-11-11 12:54:49
【问题描述】:
我可以在 Linux 的命令行上正常运行这个:
$ tar c my_dir | md5sum
但是当我尝试用 Python 调用它时,我得到一个错误:
>>> subprocess.Popen(['tar','-c','my_dir','|','md5sum'],shell=True)
<subprocess.Popen object at 0x26c0550>
>>> tar: You must specify one of the `-Acdtrux' or `--test-label' options
Try `tar --help' or `tar --usage' for more information.
【问题讨论】:
-
你为什么要散列一个 tar 文件?您的意思是要查找文件内容的更改吗?还是验证外部创建的 tar 文件?
标签: python popen subprocess