Skip to content

Commit

Permalink
Make cp's buffer size larger and configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimfulton committed Feb 10, 2018
1 parent 26a04c7 commit 0fdc7e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ZODB/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def u64(v):
U64 = u64


def cp(f1, f2, length=None):
def cp(f1, f2, length=None, bufsize=1 << 16):
"""Copy all data from one file to another.
It copies the data from the current position of the input file (f1)
Expand All @@ -106,7 +106,7 @@ def cp(f1, f2, length=None):
"""
read = f1.read
write = f2.write
n = 8192
n = bufsize

if length is None:
old_pos = f1.tell()
Expand Down

0 comments on commit 0fdc7e2

Please sign in to comment.