Answers:
我想你是说strace -fetrace=open
什么?
dtruss -f -t打开python myfile.py
dtruss
需要root特权,但是您可能不想以root用户身份运行要跟踪的命令。考虑一下sudo dtruss -f -t open sudo -u $USER python myfile.py
$ sudo dtruss -f -t open sudo -u $USER python
:dtrace:系统完整性保护处于打开状态,某些功能将不可用,然后dtrace: failed to execute sudo: dtrace cannot control executables signed with restricted entitlements