Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
enlarge buffer size when writing file-like object
Browse files Browse the repository at this point in the history
  • Loading branch information
jbremer committed May 19, 2017
1 parent 831a985 commit ca2485d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cuckoo/common/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ def create(root, filename, content):
filepath = os.path.join(root, filename)
with open(filepath, "wb") as f:
if hasattr(content, "read"):
chunk = content.read(1024)
chunk = content.read(1024 * 1024)
while chunk:
f.write(chunk)
chunk = content.read(1024)
chunk = content.read(1024 * 1024)
else:
f.write(content)
return filepath
Expand Down

0 comments on commit ca2485d

Please sign in to comment.