def copyTo(self, destination, followLinks=True):
        if self.islink() and not followLinks:
            os.symlink(os.readlink(self.path), destination.path)
            return
        # XXX TODO: *thorough* audit and documentation of the exact desired
        # semantics of this code.  Right now the behavior of existent
        # destination symlinks is convenient, and quite possibly correct, but
        # its security properties need to be explained.
        if self.isdir():
            if not destination.exists():
                destination.createDirectory()
            for child in self.children():
                destChild = destination.child(child.basename())
                child.copyTo(destChild, followLinks)
        elif self.isfile():
            writefile = destination.open('w')
            try:
                readfile = self.open()
                try:
                    while 1:
                        # XXX TODO: optionally use os.open, os.read and O_DIRECT
                        # and use os.fstatvfs to determine chunk sizes and make
                        # *****sure**** copy is page-atomic; the following is
                        # good enough for 99.9% of everybody and won't take a
                        # week to audit though.
                        chunk = readfile.read(self._chunkSize)
                        writefile.write(chunk)
                        if len(chunk) < self._chunkSize:
                            break
                finally:
                    readfile.close()
            finally:
                writefile.close()
        elif not self.exists():
            raise OSError(errno.ENOENT, "No such file or directory")
        else:
            # If you see the following message because you want to copy
            # symlinks, fifos, block devices, character devices, or unix
            # sockets, please feel free to add support to do sensible things in
            # reaction to those types!
            raise NotImplementedError(
                "Only copying of files and directories supported")
Copies self to destination.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/python/filepath.py/FilePath.copyTo