Copy file

@param	string	path to target directory, must be valid
@return	bool
340067
public function copy($new_path)
	{
		$info = pathinfo($this->path);
		$new_path = $this->area->get_path($new_path);

		$new_path = rtrim($new_path, '\\/').DS.$info['basename'];

		return $this->area->copy($this->path, $new_path);
	}
671341
public function copy($path, $newpath)
    {
        $url = cloudinary_url_internal($path);
        $result = Uploader::upload($url, ['public_id' => $newpath]);

        return is_array($result) ? $result['public_id'] == $newpath : false;
    }
726439
public static function rmdir($path)
    {
        $files = array_diff(scandir($path), array('.', '..'));

        $filesystem = new Filesystem();

        foreach ($files as $file) {
            $file = $path . DIRECTORY_SEPARATOR . $file;

            if (!file_exists($file)) {
                continue;
            }

            try {
                $filesystem->remove($file);
            } catch (IOException $exception) {
                return false;
            }
        }

        return true;
    }
675093
public function copyTo($path)
    {
        foreach ($this->assets as $assetName => $assetPath) {
            $outputPath = $path . '/' . $assetName;

            $this->copyFromTo($assetPath, $outputPath);
        }
    }
27610
static function copy( $sourceFilename, $destinationFilename )
    {
        if ( is_dir( $sourceFilename ) )
        {
            eZDebug::writeError( "Unable to copy directory $sourceFilename, use eZDir::copy instead", __METHOD__ );
            return false;
        }
        $sourceFD = @fopen( $sourceFilename, 'rb' );
        if ( !$sourceFD )
        {
            eZDebug::writeError( "Unable to open source file $sourceFilename in read mode", __METHOD__ );
            return false;
        }
        if ( is_dir( $destinationFilename ) )
        {
            $dirPosition = strrpos( $sourceFilename, '/' );
            $filePosition = 0;
            if ( $dirPosition !== false )
                $filePosition = $dirPosition + 1;
            if ( strlen( $destinationFilename ) > 0 and
                 $destinationFilename[strlen( $destinationFilename ) - 1] == '/' )
                $destinationFilename .= substr( $sourceFilename, $filePosition );
            else
                $destinationFilename .= '/' . substr( $sourceFilename, $filePosition );
        }

        // If source and destination are the same files we just return true
        if ( $sourceFilename == $destinationFilename )
        {
            @fclose( $sourceFD );
            return true;
        }

        $destinationFD = fopen( $destinationFilename, 'wb' );
        chmod( $destinationFilename, octdec( eZINI::instance()->variable( 'FileSettings', 'StorageFilePermissions' ) ) );
        if ( !$destinationFD )
        {
            @fclose( $sourceFD );
            eZDebug::writeError( "Unable to open destination file $destinationFilename in write mode", __METHOD__ );
            return false;
        }
        $bytesCopied = 0;
        do
        {
            $data = fread( $sourceFD, 4096 );
            if ( strlen( $data ) == 0 )
                break;
            fwrite( $destinationFD, $data );
            $bytesCopied += strlen( $data );
        } while( true );

        @fclose( $sourceFD );
        @fclose( $destinationFD );
        return true;
    }
359174
public function copy($src, $rel_path){
		$path = $this->setDir($rel_path);
		if( !($exist = file_exists($src)) ){
			trigger_error(sprintf('File %s doesn\'t exist.', $src), E_USER_WARNING);
		}
		return $path && $exist && copy($src, $path)
			? $path
			: false;
	}
410190
def copy_file(self, path):
        
        if "*" in path:
            paths = _expand_paths(path)
            if paths:
                for path in paths:
                    self._copy_file(path)
        else:
            if os.path.isfile(path):
                return self._copy_file(path)
            else:
                logger.debug("File %s does not exist", path)
                return False
279039
public function copy($target) {
        if (!parent::copy($target))
            return false;
        return copy($this->fileSource, $target);
    }
812553
protected function move($sourcePath, $targetPath)
    {
        if ($this->filesystem->has($targetPath)) {
            return false;
        }

        $stream = fopen($sourcePath, 'r+');
        if ($stream === null) {
            return false;
        }

        $success = $this->filesystem->writeStream($targetPath, $stream);

        if (fclose($stream) === false) {
            return false;
        }

        unlink($sourcePath);

        return $success;
    }
1283348
def copy_files_from_path(path)
      UI.success("Exporting Files:")
      Dir[path].each do |f|
        existing_file = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(f))
        # If the target file already exists in output directory
        # we have to remove it first, otherwise cp_r fails even with remove_destination
        # e.g.: there are symlinks in the .framework
        if File.exist?(existing_file)
          UI.important("Removing #{File.basename(f)} from output directory") if FastlaneCore::Globals.verbose?
          FileUtils.rm_rf(existing_file)
        end
        FileUtils.cp_r(f, File.expand_path(Gym.config[:output_directory]), remove_destination: true)
        UI.message("\t ▸ #{File.basename(f)}")
      end
    end
1367537
public function createFile($path)
    {
        $node = $this->at($path);
        if ($node !== null && $node->type == 'dir') {
            return false;
        }

        $node = $this->at(dirname($path));
        if (null === $node) {
            return false;
        }

        $this->at($path, (object) [
            'type' => 'file',
            'perms' => 0664,
            'content' => ''
        ]);
        return true;
    }
798814
public void copy(File path) {
        FileFilter filter = new FileFilter() {
            @Override
            public boolean accept(File file) {
                return (!config.getAssetIgnoreHidden() || !file.isHidden()) && (file.isFile() || FileUtil.directoryOnlyIfNotIgnored(file));
            }
        };
        copy(path, config.getDestinationFolder(), filter);
    }
963760
public static function empty_dir(string $path) {
		if (! @\is_readable($path) || ! @\is_dir($path)) {
			return false;
		}

		// Scan all files in dir.
		if ($handle = @\opendir($path)) {
			while (false !== ($file = @\readdir($handle))) {
				// Anything but a dot === not empty.
				if (('.' !== $file) && ('..' !== $file)) {
					return false;
				}
			}
			\closedir($handle);
			return true;
		}

		return false;
	}
315883
public function copyFromDFS( $srcFilePath, $dstFilePath = false )
    {
        return $this->getHandler( $srcFilePath )->copyFromDFS( $srcFilePath, $dstFilePath );
    }
1164142
public static function copy(String $source, String $target) : Bool
    {
        return Filesystem::copy(Info::rpath($source), Info::rpath($target));
    }
487446
public function copyFile($origFilePath, $targetFilePath, $publicAccess = true)
	{
		$origFilePath = str_replace('//', '/', $origFilePath);
		$targetFilePath = str_replace('//', '/', $targetFilePath);
		$result = $this->s3Client->copyObject(array(
			'Bucket' => $this->getBucket(),
			'CopySource' => $origFilePath,
			'Key'    => $targetFilePath,
			'ACL'    => $publicAccess ? self::PUBLIC_READ : self::PRIVATE_ACCESS
		));

		return $result;
	}
124804
public function copy($path, $newpath)
    {
        return (bool) $this->normalizeResponse(
            $this->cosApi->copyFile($this->getBucket(), $path, $newpath, true)
        );
    }