use file's python bindings

This commit is contained in:
S.Çağlar Onur
2007-03-28 23:57:21 +00:00
parent 50e59b7111
commit 9a80df9aff
+4 -2
View File
@@ -17,6 +17,7 @@ import os
import re
import sys
import sha
import magic
import shutil
import string
import statvfs
@@ -532,8 +533,9 @@ def strip_directory(top, excludelist=[]):
def strip_file(filepath, outpath):
"""Strip an elf file from debug symbols."""
p = os.popen("file \"%s\"" % filepath)
o = p.read()
ms = magic.open(magic.MAGIC_NONE)
ms.load()
o = ms.file(filepath)
def run_strip(f, flags=""):
p = os.popen("strip %s %s" %(flags, f))