def extractor(self, fname):
        result = None
        fname = os.path.abspath(fname)
        out_dir = os.path.join(os.path.dirname(fname), self.CPIO_OUT_DIR)

        try:
            fpin = open(fname, "rb")
            fperr = open(os.devnull, "rb")
            os.mkdir(out_dir)
        except OSError:
            return

        try:
            curdir = os.getcwd()
            os.chdir(out_dir)
        except OSError:
            return

        try:
            result = subprocess.call(['cpio', '-d', '-i', '--no-absolute-filenames'],
                                     stdin=fpin,
                                     stderr=fperr,
                                     stdout=fperr)
        except OSError:
            result = -1

        os.chdir(curdir)
        fpin.close()
        fperr.close()

        if result in [0, 2]:
            return True
        else:
            return False
dataset/ETHPy150Open devttys0/binwalk/src/binwalk/plugins/cpio.py/CPIOPlugin.extractor/original