copies the source to the destination

@param  {String} src  the source file
@param  {String} dest the destination file
18067
function(src, dest){
      self.logger.info('generating '+dest); 
      fs.createReadStream(src).pipe(fs.createWriteStream(dest)); 
    }
1163105
public static function copyTo(StreamInterface $src, $dest)
    {
        $destStream = $dest instanceof StreamInterface ? $dest : new Stream($dest, Stream::MODE_READ_WRITE_RESET);

        static::copy($src, $destStream);

        $destStream->close();
    }
1186341
public static void copyFile(File src, File dest) throws IOException {

        if (src == null)
            throw new NullPointerException("Source must not be null");
        if (dest == null)
            throw new NullPointerException("Destination must not be null");
        if (!src.exists())
            throw new FileNotFoundException("Source '" + src + "' does not exist");
        if (!src.isFile())
            throw new IOException("Source '" + src + "' is not a file");
        if (dest.exists())
            throw new IOException("Destination '" + dest + "' is already exists");

        FileChannel in = null, out = null;
        try {
            in = new FileInputStream(src).getChannel();
            out = new FileOutputStream(dest).getChannel();

            in.transferTo(0, in.size(), out);
        } finally {
            try {
                in.close();
                out.close();
            } catch (IOException e) {
                // Ignore.
            }
        }

        if (src.length() != dest.length()) {
            throw new IOException("Failed to copy full contents from '" +
                src + "' to '" + dest + "'");
        }

        dest.setLastModified(src.lastModified());
    }
891648
public static void copyFiles(File src, File dest) throws IOException {
        if (src.isDirectory()) {
            dest.mkdirs();
            String list[] = src.list();
            for (String fileName : list) {
                String dest1 = dest.getPath() + "/" + fileName;
                String src1 = src.getPath() + "/" + fileName;
                // i.e: avoid .svn directory
                File src1_ = new File(src1);
                File dest1_ = new File(dest1);
                if (!src1_.isHidden()) {
                    copyFiles(src1_, dest1_);
                }
            }
        } else {

            FileInputStream fin = new FileInputStream(src);
            FileOutputStream fout = new FileOutputStream(dest);
            int c;
            while ((c = fin.read()) >= 0) {
                fout.write(c);
            }
            fin.close();
            fout.close();
        }
    }
289524
public void copyToLocalFile(boolean delSrc, Path src, Path dst)
    throws IOException {
    fs.copyToLocalFile(delSrc, src, dst);
  }
100208
function copyFile(source, dest) {

  fs.stat(dest, function (err, stats) {

    // If there was an error that is NOT that the file doesn't exist, then throw it.
    if (err && err.code !== 'ENOENT') {
      throw new Error(err);
    }

    // If the file exists then skip it.
    if (typeof stats === 'object') {
      process.stdout.write(`File exists: skipping (${dest})\n`);
    }

    return fs.createReadStream(source)
      .pipe(fs.createWriteStream(dest));

  });

}
958696
public function put($src, $dest){
		if ( file_exists($src) &&
            ($dest = $this->checkFilePath($dest)) &&
            ftp_put($this->cn,$dest,$src,FTP_BINARY) ){
      return true;
		}
		return false;
	}
379932
function copyFile (src, dest, ncpOpts, callback) {
  var orchestrator = new Orchestrator();
  var parts = dest.split(path.sep);
  var fileName = parts.pop();
  var destDir = parts.join(path.sep);
  var destFile = path.resolve(destDir, fileName);
  orchestrator.add('ensureDir', function (done) {
    mkdirp(destDir, function (err) {
      done(err);
    });
  });
  orchestrator.add('copyFile', ['ensureDir'], function (done) {
    ncp(src, destFile, ncpOpts, function (err) {
      done(err);
    });
  });
  orchestrator.start('copyFile', function (err) {
    callback(err);
  });
}
155955
public static function copy_dir($src, $dest, $hidden = false, $fsencoding = '') {
        $src = strval($src);
        if ($src == '') {
            return;
        }
        $src = self::conv_to($src, $fsencoding);
        $dest = self::conv_to($dest, $fsencoding);
        self::mkdir($dest);
        if (!\is_dir($dest) || !\is_dir($src)) {
            return;
        }
        if (substr($src, -1) !== '/') {
            $src .= '/';
        }
        if (substr($dest, -1) !== '/') {
            $dest .= '/';
        }
        if ($dh = opendir($src)) {
            while (($file = readdir($dh)) !== false) {
                if ($file === '.' || $file === '..') {
                    continue;
                }
                if ($file{0} == '.' && !$hidden) {
                    continue;
                }
                $from = $src . $file;
                $to = $dest . $file;
                if (is_dir($from)) {
                    self::copy_dir($from, $to, $hidden);
                }
                else {
                    self::copy($from, $to);
                }
            }
            closedir($dh);
        }
    }
513987
public static void fileCopy(final File src, final File dest, final boolean overwrite) throws IOException {
        if (!dest.exists() || (dest.exists() && overwrite)) {
            // Create parent directory structure if necessary
            FileUtils.mkParentDirs(dest);

            if (overwrite) {
                Files.copy(src.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
            } else {
                Files.copy(src.toPath(), dest.toPath());
            }
        }
    }
1034455
public static ByteBuffer copy(ByteBuffer src, ByteBuffer dest) {
		return copy(src, dest, Math.min(src.limit(), dest.remaining()));
	}
571061
public static function copy($src, $dest, $force = false)
	{
		if (is_dir($src)) {
			Dir::copy($src, $dest, $force);
		} elseif (is_file($src)) {
			File::copy($src, $dest, $force);
		}

		return true;
	}
148258
public static Object copy(Object src, int srcPos, Object dest, int destPos, int length) {
		System.arraycopy(src, srcPos, dest, destPos, length);
		return dest;
	}
937569
public function MoveFolder($source,$dest){
        $this->CopyFiles($source,$dest);
        $this->RemoveFiles($source);
    }
63859
public static function copy($src, $dest, $force = false)
    {
        @set_time_limit((int) ini_get('max_execution_time'));

        // Eliminate trailing directory separators, if any
        $src = rtrim($src, '/\\');
        $dest = rtrim($dest, '/\\');

        if (!is_dir($src)) {
            throw new FilesystemException('Source folder not found', -1);
        }

        if (is_dir($dest) && !$force) {
            throw new FilesystemException('Destination folder exists', -1);
        }

        // Make sure the destination exists
        if (!static::create($dest)) {
            throw new FilesystemException('Cannot create destination folder', -1);
        }

        $sources = static::items($src, true, static::PATH_RELATIVE);

        // Walk through the directory copying files and recursing into folders.
        foreach ($sources as $file) {
            $srcFile = $src . '/' . $file;
            $destFile = $dest . '/' . $file;

            if (is_dir($srcFile)) {
                static::create($destFile);
            } elseif (is_file($srcFile)) {
                File::copy($srcFile, $destFile, $force);
            }
        }

        return true;
    }
1300314
public static function copyFile(string $source, string $dest)
    {
        $dir = dirname($dest);
        if (!is_dir($dir)) {
            mkdir($dir, 0700, true);
        }
        copy($source, $dest);
    }
643477
def copy_func(dest, src, symlinks=True):
    

    dest = str(dest)
    src = str(src)

    SCons.Node.FS.invalidate_node_memos(dest)
    if SCons.Util.is_List(src) and os.path.isdir(dest):
        for file in src:
            shutil.copy2(file, dest)
        return 0
    elif os.path.islink(src):
        if symlinks:
            return os.symlink(os.readlink(src), dest)
        else:
            return copy_func(dest, os.path.realpath(src))
    elif os.path.isfile(src):
        shutil.copy2(src, dest)
        return 0
    else:
        shutil.copytree(src, dest, symlinks)
        # copytree returns None in python2 and destination string in python3
        # A error is raised in both cases, so we can just return 0 for success
        return 0