13 ROOT.gErrorIgnoreLevel = 6000
15 for root, dirs, files
in os.walk(d):
18 path = os.path.join(root, f)
19 if os.path.splitext(f)[1] !=
".root":
21 tfile = ROOT.TFile(path,
"read")
22 kill = tfile.IsZombie()
or not tfile.IsOpen()
25 print "Removing "+path
28 if __name__ ==
"__main__":
29 parser = argparse.ArgumentParser(description=
"Recursively removes zombie ROOT files from given directories.",
30 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
31 parser.add_argument(
"in_dirs", nargs=
"*", default=[
"."],
32 help=
"List of directories from which to purge zombie files.")
33 args = parser.parse_args()