Upload a local file

@param string $source local file
@param string $target remove file
@return bool

@throws \Icewind\SMB\Exception\NotFoundException
@throws \Icewind\SMB\Exception\InvalidTypeException
19747
public function put($source, $target) {
		$sourceHandle = fopen($source, 'rb');
		$targetHandle = $this->getState()->create($this->buildUrl($target));

		while ($data = fread($sourceHandle, NativeReadStream::CHUNK_SIZE)) {
			$this->getState()->write($targetHandle, $data);
		}
		$this->getState()->close($targetHandle);
		return true;
	}
221329
private function renameFile($source, $target)
    {
        if (false === @rename($source, $target)) {
            throw new RuntimeException(sprintf('Could not write new cache file to %s.', $target));
        }
    }
761120
protected function addIfIsset(array &$target, $key, array $source)
    {
        if (isset($source[$key])) {
            $target[$key] = $source[$key];
            return true;
        }
        return false;
    }
1164142
public static function copy(String $source, String $target) : Bool
    {
        return Filesystem::copy(Info::rpath($source), Info::rpath($target));
    }
935014
public static function zipExtract(String $source, String $target = NULL) : Bool
    {
        $source = Info::rpath($source);
        $target = Info::rpath($target);

        $source = Base::suffix($source, '.zip');

        if( ! file_exists($source) )
        {
            throw new Exception\FileNotFoundException(NULL, $source);
        }

        if( empty($target) )
        {
            $target = Extension::remove($source);
        }

        $zip = new ZipArchive;

        if( $zip->open($source) === true )
        {
            $zip->extractTo($target);
            $zip->close();

            return true;
        }
        else
        {
            return false;
        }
    }
395852
public static function copy($source, $target)
    {
        if (false === is_dir($source)) {
            return copy($source, $target);
        }

        self::mkdir($target);

        $dirSource = dir($source);

        while (false !== ($fileEntry = $dirSource->read())) {
            if (true === in_array($fileEntry, self::getDirSymbols())) {
                continue;
            }

            if (false === self::copy(sprintf('%s/%s', $source, $fileEntry), sprintf('%s/%s', $target, $fileEntry))) {
                return false;
            }

        }

        $dirSource->close();

        return true;
    }
945756
public function copy($target) {
        if (!parent::copy($target))
            return false;
        return file_put_contents($target, $this->content) !== false;
    }
805929
public function moveFile( $source, $destination )
    {
        $result = copy( $source, $destination );

        if ( TRUE === $result )
        {
            $this->deleteFile( $source );
        }

        return $result;
    }
959821
private function copyThenRemove($source, $target)
    {
        if (!is_dir($source)) {
            copy($source, $target);
            $this->unlink($source);

            return;
        }

        $it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS);
        $ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);
        $this->ensureDirectoryExists($target);

        foreach ($ri as $file) {
            $targetPath = $target.DIRECTORY_SEPARATOR.$ri->getSubPathName();
            if ($file->isDir()) {
                $this->ensureDirectoryExists($targetPath);
            } else {
                copy($file->getPathname(), $targetPath);
            }
        }

        $this->removeDirectoryPhp($source);
    }
599346
public function thumbnail(&$source, $target, array $action)
    {
        list($width, $height) = $action['value'];

        if ($this->image->set($source)->thumbnail($width, $height)->save($target)) {
            $source = $target;
            return true;
        }

        return false;
    }
421130
public function uploadFile($sourcePath, $targetPath, $publicAccess = true, $allowRewriteFile = false)
	{
		// check if the file does not already exists, if exist, don't upload
		if ($allowRewriteFile !== true && $this->isFile($targetPath)) {
			return false;
		}
		return $this->s3Client->putObject(array(
			'Bucket'     => $this->getBucket(),
			'Key'        => $targetPath,
			'SourceFile' => $sourcePath,
			'ACL'        => $publicAccess ? self::PUBLIC_READ : self::PRIVATE_ACCESS
		));
	}
1367434
public function moveFiles($source, $target, $files)
    {
        foreach ($files as $file) {
            $this->moveFile($source, $target, $files);
        }
    }
328615
public static function create($source, $target)
    {
        $message = sprintf('Dependency `%s` not found, required by `%s`', $target, $source);
        $exception = new static($message, 0, null, $source, $target);

        return $exception;
    }
681127
public function extract($source, $target)
    {
        if (!$sourceRes = gzopen($source, 'r')) {
            throw new \RuntimeException(sprintf('Unable to read archive file "%s".', $source));
        }
        if (!$targetRes = fopen($target, 'w')) {
            throw new \RuntimeException(sprintf('Unable to write target file "%s".', $target));
        }
        while (!gzeof($sourceRes)) {
            fwrite($targetRes, gzread($sourceRes, $this->bufferSize));
        }
        if (!gzclose($sourceRes)) {
            throw new \RuntimeException(sprintf('Unable to close archive file "%s".', $source));
        }
        if (!fclose($targetRes)) {
            throw new \RuntimeException(sprintf('Unable to close target file "%s".', $target));
        }
    }
310204
public function copy($target, $source)
    {
        $source_stream = $this->readStream($source);
        $result = $this->writeStream($target, $source_stream);

        fclose($source_stream);

        return $result;
    }
1104183
public function storeFile($input = null, $target)
    {
        // The input name and target path must be defined
        if (!isset($input) || !isset($target)) {
            throw new \InvalidArgumentException('Undefined input name or target', 400);
        }

        // Move the uploaded file
        $result = move_uploaded_file($_FILES[$input]['tmp_name'], $target);

        // Check if the file was stored
        if (!$result) {
            throw new \InvalidArgumentException('The file could not be stored', 500);
        }

        // Return the file info
        return $result;
    }
858285
private function _copySection($source, &$target)
    {
        foreach ($source as $key => $value) {

            if (!array_key_exists($key, $target)) $target[$key] = $value;
        }
    }