I am trying to execute the following code in Python
import os,subprocess
from glob import glob
path = "/Users/armed/private_SDKs"
os.chdir(path)
for file in glob("*.framework"):
command = ['class-dump' , '-H' , file , '-o' , '~', '/Users/armed/Desktop/Headers/']
subprocess.call(command)
On executing this script i get the following error :-
Traceback (most recent call last):
File "<pyshell#52>", line 3, in <module>
subprocess.call(command)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Any help is much appreciated !
Check permissions of the class-dump command.
chmod +x class-dumpif it’s not executable. Here are the docs on chmod.You might also need to specify the absolute path to class-dump if it’s not on your path.
Also, try:
and see if you can run it by pasting the results into a shell.