Last active
January 29, 2020 13:18
-
-
Save serhiy-storchaka/22fbf90568f7f5fee32b2c2f331685ae to your computer and use it in GitHub Desktop.
Copy files using mmap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, mmap | |
with open(sys.argv[1], 'rb') as src: | |
with open(sys.argv[2], 'wb') as dst: | |
mm = mmap.mmap(src.fileno(), 0, access=mmap.ACCESS_READ) | |
dst.write(mm) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment