Copies a file from the given source path to the given public path.
THIS IS NOT FOR PATTERNS
@param  {String}       the source file
@param  {String}       the public file
514053
protected static function moveFile($s,$p) {
		
		// default vars
		$sourceDir = Config::getOption("sourceDir");
		$publicDir = Config::getOption("publicDir");
		
		$fs = new Filesystem();
		$fs->copy($sourceDir.DIRECTORY_SEPARATOR.$s,$publicDir.DIRECTORY_SEPARATOR.$p);
		
	}
246644
function copyFile(from, to) {
  return new Promise((resolve, reject) => {
    fs.copyFile(from, to, (err) => {
      if (err) {
        reject(err);
        return;
      }
      resolve(to);
    });
  });
}
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);
  });
}
357994
public static final void copyResource(String source, Path target, Class<?> cls) throws IOException
    {
        try (InputStream is = cls.getResourceAsStream(source))
        {
            Files.copy(is, target, REPLACE_EXISTING);
        }
    }
329928
public static Path copy(Path sourcePath, Path destinationPath,
            CopyOption... options) {
        return operate(sourcePath, destinationPath, "copy", finalPath -> {
            try {
                return Files.copy(sourcePath, finalPath, options);
            } catch (Exception e) {
                return JMExceptionManager.handleExceptionAndReturnNull(log, e,
                        "copy", sourcePath, destinationPath, options);
            }
        });
    }
1267230
public static function copyFile($source, $path)
    {
        $path = str_replace('\\', '/', $path);
        $arr = explode('/', $path);
        array_pop($arr);
        $folder = join('/', $arr);
        if (!is_dir($folder)) {
            self::createFolder($folder);
        }
        if (is_file($source)) {
            copy($source, $path);
        }
    }
656504
function copy (source, target) {
    var defer = Q.defer()
    fs.createReadStream(source)
      .on('error', defer.reject.bind(defer))
      .pipe(fs.createWriteStream(target))
      .on('error', defer.reject.bind(defer))
      .on('finish', defer.fulfill.bind(defer))

    return defer.promise
  }
1248965
function copyFile (src, done) {
        var dest = path.join(outdir, path.relative(compiler.dirname, src))
        var dirname = utils.dirname(dest)

        if (dirname === dest) {
          copy(src, dest, compiler.dirname, done)
        } else {
          mkdirp(dirname, function (err) {
            if (err) return done(err)
            copy(src, dest, compiler.dirname, done)
          })
        }
      }
74542
function copy(from, to){
  to = to || from;
  from = path.join(tpl, from);
  fs.createReadStream(from).pipe(fs.createWriteStream(to));
}
973338
function(src,dest, isfile){
                //console.log('test');
                
                if (isfile){
                    grunt.file.copy(src,dest+'/'+src,{});
                    console.log('File has been created as '+dest+'/'+src);
                    return;
                }
                
                grunt.file.recurse(src, function(abspath, rootdir, subdir, filename){
                    var _ref3=(typeof subdir=='undefined'?'':(subdir+'/'));
                    grunt.file.copy(abspath,dest+'/'+src+'/'+_ref3+filename, {});
                    console.log('File has been created as '+dest+'/'+src+'/'+filename);
                });
                
            }
283487
function copySchemaFiles() {
    const resolvedSrcSchemaPaths = path.resolve(rootDir, srcSchemaPaths);

    glob(resolvedSrcSchemaPaths, void(0), function(error, files) {
        files.forEach((filePath) => {
        const destSchemaPath = filePath.replace(/(\bsrc\b)(?!.*\1)/, destDir);
            fs.copyFileSync(filePath, destSchemaPath);
        });
    });
}
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());
    }
642804
public static void copyFile(String fromPath, String toPath) throws Exception {
        File inputFile = new File(fromPath);
        File outputFile = new File(toPath);
        com.google_voltpatches.common.io.Files.copy(inputFile, outputFile);
    }
925444
function copy(obj) {
  var filters = copy.filterFactory(obj.filter);
  var source = copy.sourceFactory(obj.source, filters);
  var dest = copy.destFactory(obj.dest, filters);
  dest.processSource(source);
}
134900
function mutateJsonFile(targetPath, source, mutator) {
  if (!mutator) {
    mutator = source;
    source = null;
  }
  let sourceConfig = source;
  try {
    // console.log('targetPath', targetPath);

    let targetConfig = readJson(targetPath);

    // console.log('source', source);
    if (typeof source === 'string') {
      sourceConfig = readJson(source);
    }
    // console.log('sourceConfig', targetPath, sourceConfig)
    sourceConfig = sourceConfig ? sourceConfig : targetConfig;

    let newConfig = mutator(targetConfig, sourceConfig);

    writeJson(targetPath, newConfig, {spaces: 2});

  } catch (e) {
    log.error('Error: operating on aurelia.json. Reverting to previous version ;{}', e);
    writeJson(targetPath, sourceConfig, {spaces: 2});
  }
}
688527
def copy_file(self, from_path, to_path, replace=False):
        
        f = self.get_file(from_path)
        if f.copy(to_path, replace):
            self.set_cache_buster(to_path, f.hash())
552874
function copy() {

		// Copy dist files
		var distFolder = Release.dir.dist + "/dist",
			externalFolder = Release.dir.dist + "/external",
			readme = fs.readFileSync( Release.dir.dist + "/README.md", "utf8" ),
			rmIgnore = files
				.concat( [
					"README.md",
					"node_modules"
				] )
				.map( function( file ) {
					return Release.dir.dist + "/" + file;
				} );

		shell.config.globOptions = {
			ignore: rmIgnore
		};

		// Remove extraneous files before copy
		shell.rm( "-rf", Release.dir.dist + "/**/*" );

		shell.mkdir( "-p", distFolder );
		files.forEach( function( file ) {
			shell.cp( "-f", Release.dir.repo + "/" + file, distFolder );
		} );

		// Copy Sizzle
		shell.mkdir( "-p", externalFolder );
		shell.cp( "-rf", Release.dir.repo + "/external/sizzle", externalFolder );

		// Copy other files
		extras.forEach( function( file ) {
			shell.cp( "-rf", Release.dir.repo + "/" + file, Release.dir.dist );
		} );

		// Remove the wrapper from the dist repo
		shell.rm( "-f", Release.dir.dist + "/src/wrapper.js" );

		// Write generated bower file
		fs.writeFileSync( Release.dir.dist + "/bower.json", generateBower() );

		fs.writeFileSync( Release.dir.dist + "/README.md", editReadme( readme ) );

		console.log( "Files ready to add." );
		console.log( "Edit the dist README.md to include the latest blog post link." );
	}