After investigating the 50kb of C++ GNU copy implementation (found here http://ftp.gnu.org/gnu/coreutils/) the only suggestion I have is to load and process the file in large-ish chunks (say 512kb or 1mb). This will allow copying of larger files without blowing memory/introducing odd crashes. If that's too much, then at least add a comment saying that the file must fit in memory, and maybe a warning when trying to copy big files (over 16mb?).