File: cde_script_utils.py

package info (click to toggle)
cde 0.1%2Bgit9-g551e54d-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,340 kB
  • ctags: 10,812
  • sloc: ansic: 75,881; sh: 4,282; python: 1,006; perl: 438; makefile: 297; lisp: 44; java: 5
file content (10 lines) | stat: -rw-r--r-- 361 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
import subprocess

def run_cmd(args):
  (cmd_stdout, cmd_stderr) = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
  return (cmd_stdout, cmd_stderr)


def is_dynamic_ELF_exe(filename):
  file_out, _ = run_cmd(['file', filename])
  return ("ELF" in file_out and "executable" in file_out and "dynamically linked" in file_out)