def copyfile(src, dst):
if _samefile(src, dst):<EOL><INDENT>raise Error("<STR_LIT>" % (src, dst))<EOL><DEDENT>for fn in [src, dst]:<EOL><INDENT>try:<EOL><INDENT>st = os.stat(fn)<EOL><DEDENT>except OSError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if stat.S_ISFIFO(st.st_mode):<EOL><INDENT>raise SpecialFileError("<STR_LIT>" % fn)<EOL><DEDENT><DEDENT><DEDENT>with open(src, '<STR_LIT:rb>') as fsrc:<EOL><INDENT>with open(dst, '<STR_LIT:wb>') as fdst:<EOL><INDENT>copyfileobj(fsrc, fdst)<EOL><DEDENT><DEDENT>
Copy data from src to dst