Skip to content

Commit

Permalink
Fix extract-all for flat input zip (#14)
Browse files Browse the repository at this point in the history
* Added /build/ directory to .gitignore

* Fixed bug initialising aff4.LogicalImage instances

* fixed bugs in extract()

* fixed aff4.extractAll() NameError exeption

* Fix call to extractAll function

This patch is partially necessary to correct the `--extract-all` flag.
With this correction, `--extract-all` will work if there were no
directories ingested from an input zip.

Issue 15 reports on the problem with directories from an ingested zip.
#15

This patch builds on Pull Request 13, as I'd also found the binary-
output mode was necessary, though in a different spot.
#13

Signed-off-by: Alex Nelson <[email protected]>
  • Loading branch information
ajnelson-nist authored and blschatz committed Oct 21, 2019
1 parent 9fccc31 commit 542d645
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aff4.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def extractAll(container_name, destFolder):
except OSError as exc: # Guard against race condition
if exc.errno != errno.EEXIST:
raise
with open(destFile, "w") as destStream:
with open(destFile, "wb") as destStream:
shutil.copyfileobj(srcStream, destStream)
print ("\tExtracted %s to %s" % (pathName, destFile))

Expand Down

0 comments on commit 542d645

Please sign in to comment.