methods 
Async copyFile
@param {string} origin : file to copy
@param {string} target : file to copy in
@param {function|null} callback : operation's result
@returns {void}
979046
function _copyFile (origin, target, callback) {

			if ("undefined" === typeof origin) {
				throw new ReferenceError("Missing \"origin\" argument");
			}
				else if ("string" !== typeof origin) {
					throw new TypeError("\"origin\" argument is not a string");
				}
				else if ("" === origin.trim()) {
					throw new TypeError("\"origin\" argument is empty");
				}
			else if ("undefined" === typeof target) {
				throw new ReferenceError("Missing \"target\" argument");
			}
				else if ("string" !== typeof target) {
					throw new TypeError("\"target\" argument is not a string");
				}
				else if ("" === target.trim()) {
					throw new Error("\"target\" argument is empty");
				}
			else if ("undefined" === typeof callback) {
				throw new ReferenceError("Missing \"callback\" argument");
			}
				else if ("function" !== typeof callback) {
					throw new TypeError("\"callback\" argument is not a function");
				}
			else {

				isFileProm(origin).then((exists) => {
					return exists ? Promise.resolve() : Promise.reject(new Error("There is no origin file \"" + origin + "\""));
				}).then(() => {

					let error = false;

					const writeStream = createWriteStream(target).once("error", (_err) => {

						error = true;
						writeStream.close();

						callback(_err);

					}).once("close", () => {
						return error ? null : callback(null);
					});

					createReadStream(origin).once("error", (_err) => {
						error = true; callback(_err);
					}).pipe(writeStream);

				}).catch(callback);

			}

		}
1072674
function(inputFile, outputFile, content) {
                return Promise()
                .then(function() {
                    var outputFilePath = PathUtils.resolveInRoot(outputFolder, outputFile);

                    return fs.ensureFile(outputFilePath)
                    .then(function() {
                        return fs.copy(inputFile, outputFilePath);
                    });
                });
            }
736219
public static void copy(final File sourceFile, File targetFile, final boolean overwrite) throws IOException {
        if (sourceFile == null) {
            throw new IOException("Source must not be null");
        }

        if (targetFile == null) {
            throw new IOException("Target must not be null");
        }

        // checks
        if ((false == sourceFile.isFile()) || (false == sourceFile.exists())) {
            throw new IOException("Source file '" + sourceFile.getAbsolutePath() + "' not found!");
        }

        if (true == targetFile.exists()) {
            if (true == targetFile.isDirectory()) {

                // Directory? -> use source file name
                targetFile = new File(targetFile, sourceFile.getName());
            } else if (true == targetFile.isFile()) {
                if (false == overwrite) {
                    throw new IOException("Target file '" + targetFile.getAbsolutePath() + "' already exists!");
                }
            } else {
                throw new IOException("Invalid target object '" + targetFile.getAbsolutePath() + "'!");
            }
        } else {
            // create parent dir
            FileUtils.forceMkdir(targetFile.getParentFile());
        }

        FileInputStream input = null;
        FileOutputStream output = null;

        try {
            input = new FileInputStream(sourceFile);
            output = new FileOutputStream(targetFile);
            copy(input, output);
            output.flush();
        } finally {
            IOUtils.closeQuietly(input);
            IOUtils.closeQuietly(output);
        }
    }
786689
private function doAddDir(string $origin, string $target, $recursive): void
    {
        if (!$recursive) {
            throw new InvalidOperationException('Add dir without recursive');
        }

        $finder = Finder::create()
            ->in($origin)
            ->ignoreVCS(true)
            ->ignoreDotFiles(false)
        ;
        $fs = new Filesystem();
        $fs->mirror($origin, $target, $finder);
        $this->output->writeln(sprintf(
            'copy files from <comment>%s</comment> to <comment>%s</comment>',
            $origin,
            $target
        ));
    }
798529
function copyBase(src, dest, options, callback) {
  if (typeof options !== 'object') {
    callback = options;
    options = {};
  }

  if (arguments.length < 3) {
    return invalid.apply(null, arguments);
  }

  var fs = utils.fs; // graceful-fs (lazyily required)
  var opts = utils.extend({overwrite: true}, options);
  var cb = once(callback);
  var listener = once(ws);
  src = path.resolve(src);

  var rs = fs.createReadStream(src)
    .on('error', handleError('read', src, opts, cb))
    .once('readable', listener)
    .on('end', listener);

  function ws() {
    mkdir(dest, function(err) {
      if (err) return cb(err);
      rs.pipe(fs.createWriteStream(dest, writeOpts(opts))
        .on('error', handleError('write', dest, opts, cb))
        .on('close', handleClose(src, dest, cb)));
    });
  }
}
1174298
function copyFile (src, dest) {
  return new Promise((resolve, reject) => {
    const read = fs.createReadStream(src);
    read.on('error', reject);
    const write = fs.createWriteStream(dest);
    write.on('error', reject);
    write.on('finish', resolve);
    read.pipe(write);
  })
}
865286
function (source, destination) {
    return cont.mapAsync(readFileAsJSON(source), function (json, cb) {
        json.copied = Date.now()
        fs.writeFile(destination, JSON.stringify(json), cb)
    })
}
121157
function(callback) {
                //We want it once for the object path.
                e.once('cp#complete', function(err, destination, method) {
                    if (err) {
                        console.error(err.stack)
                    }
                    console.debug('cp() completed copy to: ', method);
                    callback(err, destination, method)
                })
            }
744968
public static void copyResourceFile(String source, Path target) throws IOException {
        InputStream resource = FsCrawlerUtil.class.getResourceAsStream(source);
        FileUtils.copyInputStreamToFile(resource, target.toFile());
    }
243524
function copyFileSync(src, dest) {
  if (!fs.lstatSync(src).isFile()) {
    throw new Error(`copyFileSync expected file but got: ${src}`);
  }
  fs.writeFileSync(dest, fs.readFileSync(src));
}
342594
public static void copy(File sourceFile, File targetFile) throws IOException {
	FileInputStream in = new FileInputStream(sourceFile);
	try {
	    FileOutputStream out = new FileOutputStream(targetFile);
	    try {
		copy(in, out);
	    } finally {
		out.close();
	    }
	} finally {
	    in.close();
	}
    }
1335959
def copymode(self, target):
        
        shutil.copymode(self.path, self._to_backend(target))
246644
function copyFile(from, to) {
  return new Promise((resolve, reject) => {
    fs.copyFile(from, to, (err) => {
      if (err) {
        reject(err);
        return;
      }
      resolve(to);
    });
  });
}
431917
function writeFiles (files, callback) {
  async.map(files, writeFile.bind(this), function (err) {
    if (err) callback(err);
    callback(null);
  });
}
111685
function gulpCopy(destination, opts) {
    const throughOptions = { objectMode: true };

    // Make sure a destination was verified
    if (typeof destination !== 'string') {
        throw new PluginError('gulp-copy', 'No valid destination specified');
    }

    // Default options
    if (opts === undefined) {
        opts = opts || {};
    } else if (typeof opts !== 'object' || opts === null) {
        throw new PluginError('gulp-copy', 'No valid options specified');
    }

    return through(throughOptions, transform);

    /**
     * Transform method, copies the file to its new destination
     * @param {object} file
     * @param {string} encoding
     * @param {function} cb
     */
    function transform(file, encoding, cb) {
        let rel = null;
        let fileDestination = null;

        if (file.isStream()) {
            cb(new PluginError('gulp-copy', 'Streaming not supported'));
        }

        if (file.isNull()) {
            cb(null, file);
        } else {
            rel = path.relative(file.cwd, file.path).replace(/\\/g, separator);

            // Strip path prefixes
            if (opts.prefix) {
                let p = opts.prefix;
                while (p-- > 0) {
                    rel = rel.substring(rel.indexOf(separator) + 1);
                }
            }

            fileDestination = path.join(destination, rel);

            // Make sure destination exists
            if (!doesPathExist(fileDestination)) {
                createDestination(fileDestination.substr(0, fileDestination.lastIndexOf(separator)));
            }

            // Copy the file
            copyFile(file.path, fileDestination, function copyFileCallback(error) {
                if (error) {
                    throw new PluginError('gulp-copy', `Could not copy file <${file.path}>: ${error.message}`);
                }

                // Update path for file so this path is used later on
                file.path = fileDestination;
                cb(null, file);
            });
        }
    }
}
103610
function copy (src, dst) {
  return new Promise((resolve, reject) => {
    fs.createReadStream(src)
      .on('error', reject)
      .pipe(fs.createWriteStream(dst)
              .on('error', reject)
              .on('close', resolve)
      )
  })
}
923783
function copyAugment (target, src, keys) {
  for (let i = 0, l = keys.length; i < l; i++) {
    const key = keys[i]
    def(target, key, src[key])
  }
}