@param string $path
@param string $newpath

@return bool
161441
public function rename($path, $newpath)
    {
        return (bool) $this->normalizeResponse(
            $this->cosApi->moveFile($this->getBucket(), $path, $newpath, true)
        );
    }
747505
public function copy($path, $newpath)
    {
        $resource = $this->read($path);

        return isset($resource['contents'])
            ? (bool)$this->update($newpath, $resource['contents'], new Config()) : false;
    }
262295
public function withPath($path)
    {
        if (!is_string($path)) {
            throw new \InvalidArgumentException('Invalid path provided; must be a string');
        }
        $path = $this->filterPath($path);

        $new = clone $this;
        $new->path = $path;

        return $new;
    }
313113
public function copy($newPath = null)
    {
        if (is_null($newPath)) {
            $newPath = $this->path . '-copy';
        }

        if (@$this->filesystem->copy($this->path, $newPath)) {
            return $this->getClone()->setPath($newPath);
        } else {
            $lastError = error_get_last();
            throw new CopyFailedException($this, $newPath, $lastError['message']);
        }
    }
624979
private function rename(string $oldPath, string $newPath): bool
    {
        if (!@rename($oldPath, $newPath)) {
            $message = 'Could not rename file.';
            if ($error = error_get_last()) {
                $message .= sprintf(' Errno: %d; %s', $error['type'], $error['message']);
            }
            throw new FileException($message);
        }

        return true;
    }
1279904
public function setPath ($path)
	{
		
		if (!is_dir ($path) && !mkdir ($path, 0755, TRUE))
		{
			return FALSE;
		}
		
		if (!is_writable ($path))
		{
			return FALSE;
		}
		
		$this->path	= $path;
		return TRUE;
		
	}
801103
public function copy($path, $newpath)
    {
        $command = $this->s3Client->getCommand(
            'copyObject',
            [
                'Bucket'     => $this->bucket,
                'Key'        => $this->applyPathPrefix($newpath),
                'CopySource' => urlencode($this->bucket . '/' . $this->applyPathPrefix($path)),
                'ACL'        => $this->getRawVisibility($path) === AdapterInterface::VISIBILITY_PUBLIC
                    ? 'public-read' : 'private',
            ] + $this->options
        );

        try {
            $this->s3Client->execute($command);
        } catch (S3Exception $e) {
            return false;
        }

        return true;
    }
375941
public function createFolder(String $path) : Bool
    {
        if( ftp_mkdir($this->connect, $path) )
        {
            return true;
        }
        else
        {
            throw new FolderAllreadyException(NULL, $path);
        }
    }
513466
public function moveFile($oldPath, $newPath, $isRename = false)
    {
        $oldPath = self::validatePath($oldPath);
        $fullOldPath = $this->getMediaPath($oldPath);

        $newPath = self::validatePath($newPath);
        $fullNewPath = $this->getMediaPath($newPath);

        return $this->getStorageDisk()->move($fullOldPath, $fullNewPath);
    }
70894
private function portFromFallback($path, $newpath)
	{
		$buffer = $this->fallback->readStream($path);

		if (false === $buffer) {
			return false;
		}

		$result = $this->mainAdapter->writeStream($newpath, $buffer['stream'], []);

		if (\is_resource($buffer['stream'])) {
			\fclose($buffer['stream']);
		}

		return (false !== $result);
	}
336941
public static function copy(string $path, string $newpath, bool $recursive = false)
    {
        if ($recursive) {

            if (!Filesystem::has($newpath)) {
                mkdir($newpath);
            }

            $splFileInfoArr = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::SELF_FIRST);

            foreach ($splFileInfoArr as $fullPath => $splFileinfo) {
                //skip . ..
                if (in_array($splFileinfo->getBasename(), [".", ".."])) {
                    continue;
                }

                //get relative path of source file or folder
                $_path = str_replace($path, "", $splFileinfo->getPathname());

                if ($splFileinfo->isDir()) {
                    mkdir($newpath."/".$_path);
                } else {
                    copy($fullPath, $newpath."/".$_path);
                }
            }
        } else {
            return copy($path, $newpath);
        }
    }
973243
public function rename($path, $newpath)
    {
        $newpath = static::normalizerPath($newpath);

        $this->writeStream($newpath, $this->readStream($path)['stream'], new Config() );

        $this->delete($path);

        return true;
    }
1342955
function nativeCopy($path, $newPath)
    {
        if (!$this->createDir(Util::dirname($newPath), new Config())) {
            return false;
        }

        $location    = $this->applyPathPrefix($this->encodePath($path));
        $newLocation = $this->applyPathPrefix($this->encodePath($newPath));

        try {
            $destination = $this->client->getAbsoluteUrl($newLocation);
            $response    = $this->client->request('COPY', '/' . ltrim($location, '/'), null, [
                'Destination' => $destination,
            ]);

            if ($response['statusCode'] >= 200 && $response['statusCode'] < 300) {
                return true;
            }
        } catch (NotFound $e) {
            // Would have returned false here, but would be redundant
        }

        return false;
    }
593317
public function moveFolder($originalPath, $newPath)
    {
        if (Str::lower($originalPath) !== Str::lower($newPath)) {
            // If there is no risk that the directory was renamed
            // by just changing the letter case in the name -
            // copy the directory to the destination path and delete
            // the source directory.

            if (!$this->copyFolder($originalPath, $newPath)) {
                return false;
            }

            $this->deleteFolder($originalPath);
        }
        else {
            // If there's a risk that the directory name was updated
            // by changing the letter case - swap source and destination
            // using a temporary directory with random name.

            $tempraryDirPath = $this->generateRandomTmpFolderName(dirname($originalPath));

            if (!$this->copyFolder($originalPath, $tempraryDirPath)) {
                $this->deleteFolder($tempraryDirPath);

                return false;
            }

            $this->deleteFolder($originalPath);

            return $this->moveFolder($tempraryDirPath, $newPath);
        }

        return true;
    }
670936
protected static function verifyPath(string $path = ''): bool
    {
        static::init();
        $currentDir = '.'.DIRECTORY_SEPARATOR;
        return (\stripos($path, static::$documentRoot) !== false && \strpos($path, $currentDir) === false);
    }
1105376
public function rename($oldPath, $newPath)
    {
        $payload = $this->getNewFileLocationPayload($newPath);

        return $this->updateMetadata($oldPath, $payload);
    }
676955
public function rename($path, $originalFileName, $newFileName)
    {
        $path = $this->cleanFolder($path);
        $nameName = $path.DIRECTORY_SEPARATOR.$newFileName;
        if ($this->disk->exists($nameName)) {
            $this->errors[] = 'The file "'.$newFileName.'" already exists in this folder.';

            return false;
        }

        return $this->disk->getDriver()->rename(($path.DIRECTORY_SEPARATOR.$originalFileName), $nameName);
    }