From acdbe784c5eae074ac6471660399dda7520da67d Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Sun, 7 Feb 2016 11:13:49 -0800 Subject: [PATCH] Fixed file extraction to only happen with -x option --- atrcopy.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atrcopy.py b/atrcopy.py index 3ebc4e0..e26fbf4 100755 --- a/atrcopy.py +++ b/atrcopy.py @@ -664,12 +664,12 @@ def process(dirent, options): if options.dry_run: action = "DRY_RUN: %s" % action skip = True - if not skip: - bytes = atr.get_file(dirent) - with open(outfilename, "wb") as fh: - fh.write(bytes) if options.extract: print "%s: %s %s" % (dirent, action, outfilename) + if not skip: + bytes = atr.get_file(dirent) + with open(outfilename, "wb") as fh: + fh.write(bytes) else: print dirent