Skip to content

Commit

Permalink
fix 64-bit file redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
crioux committed Jun 22, 2016
1 parent e3ac173 commit fa9163c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions snapdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import hashlib
import codecs
import re
import platform
import ctypes

wow64key = 0
re_excludedir = []
Expand All @@ -19,6 +19,10 @@ def Is64Windows():

if Is64Windows():
wow64key = _winreg.KEY_WOW64_64KEY
Wow64DisableWow64FsRedirection = ctypes.windll.kernel32.Wow64DisableWow64FsRedirection
old_value = ctypes.c_long()
Wow64DisableWow64FsRedirection(ctypes.byref(old_value))


def subkeys(key, numsubkeys):

Expand Down Expand Up @@ -218,6 +222,7 @@ def diff_directory(zf, dirs1, dirs2):
dpname = dp

zf.write(dp, dpname)

print "Added: " + dp
except:
print "Skipped: " + dp
Expand Down Expand Up @@ -413,7 +418,7 @@ def main():

snap2 = snap_all()

with zipfile.ZipFile(args.out, 'w', zipfile.ZIP_DEFLATED, True) as zf:
with zipfile.ZipFile(args.out, "w", zipfile.ZIP_DEFLATED, True) as zf:
print "Zipping diff to: " + args.out
diff_all(zf, snap1, snap2)

Expand Down

0 comments on commit fa9163c

Please sign in to comment.