Moves a file to a new destination
@param string $src
@param string $dest
@param int $errors
@param int $success
@return bool
193617
protected function move($src, $dest, &$errors = 0, &$success = 0)
    {
        $this->copy($src, $dest, $errors, $success);

        if (empty($errors)) {
            gplcart_file_delete_recursive($src, $errors);
        }

        return empty($errors);
    }
1285346
function move(src, dest) {
	return rename(src, dest).catch((err) => {
		// try copying
		return copy(src, dest).then(() => {
			// delete source
			return unlink(src);
		});
	});
}
260731
public static function copy($src, $dst, $mode=null) {
		if($mode === null)
			$mode = static::OVERRIDE;

		if(is_dir($src))
			return static::copyDir($src, $dst, $mode);
		else {
			if($mode & static::RENAME)
				$dst = static::getNewFilename($dst);
			elseif($mode & static::OVERRIDE)
				static::delete($dst);
			elseif(file_exists($dst))
				return false;

			static::mkdir(dirname($dst));
			$r = copy($src, $dst);

			if($r !== false)
				return $dst;
			return false;
		}
	}
423510
public static function copyDirectory(string $source, string $dest)
    {
        if (!is_dir($dest)) {
            mkdir($dest, 0700, true);
        }
        if (is_dir($source) && ($dh = opendir($source))) {
            while (($file = readdir($dh)) !== false) {
                if ($file === '.' || $file === '..') {
                    continue;
                } elseif (is_dir("{$source}/{$file}")) {
                    self::copyDirectory("{$source}/{$file}", "{$dest}/{$file}");
                } else {
                    copy("{$source}/{$file}", "{$dest}/{$file}");
                }
            }
            closedir($dh);
        }
    }
38539
protected static function copyRecursive( $src, $dest )
	{
		self::createDirectory( $dest );

		$iterator = new \RecursiveIteratorIterator(
			new \RecursiveDirectoryIterator( $src, \RecursiveDirectoryIterator::SKIP_DOTS ),
			\RecursiveIteratorIterator::SELF_FIRST
		);

		foreach( $iterator as $item )
		{
			$target = $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName();

			if( $item->isDir() === false )
			{
				if( copy( $item, $target ) === false ) {
					throw new \RuntimeException( sprintf( 'Unable to copy file "%1$s"', $item ) );
				}
			}
			else
			{
				self::createDirectory( $target );
			}
		}
	}
646823
public function copyFile($container, $dest_path, $src_container, $src_path, $check_exist = false)
    {
        // does this file already exist?
        if (!$this->fileExists($src_container, $src_path)) {
            throw new NotFoundException("File '$src_path' does not exist.");
        }
        if ($this->fileExists($container, $dest_path)) {
            if (($check_exist)) {
                throw new BadRequestException("File '$dest_path' already exists.");
            }
        }
        // does this file's parent folder exist?
        $parent = FileUtilities::getParentFolder($dest_path);
        if (!empty($parent) && (!$this->folderExists($container, $parent))) {
            throw new NotFoundException("Folder '$parent' does not exist.");
        }

        // create the file
        $this->checkContainerForWrite($container); // need to be able to write to storage
        $file = static::addContainerToName($src_container, $dest_path);
        $srcFile = static::addContainerToName($container, $src_path);
        $result = copy($srcFile, $file);
        if (!$result) {
            throw new InternalServerErrorException('Failed to copy file.');
        }
    }
571061
public static function copy($src, $dest, $force = false)
	{
		if (is_dir($src)) {
			Dir::copy($src, $dest, $force);
		} elseif (is_file($src)) {
			File::copy($src, $dest, $force);
		}

		return true;
	}
775685
public function rsyncCommand($src, $dest, array $rsyncOptions)
    {
        if (strpos($src, ':') !== false) {
            $site_env_id = $this->getSiteEnvIdFromPath($src);
            $src = $this->removeSiteEnvIdFromPath($src);
        } else {
            $site_env_id = $this->getSiteEnvIdFromPath($dest);
            $dest = $this->removeSiteEnvIdFromPath($dest);
        }

        return $this->rsync($site_env_id, $src, $dest, $rsyncOptions);
    }
727439
protected function copyFile($source, $dest)
  {
    $dir  = dirname($dest);

    if (!is_dir($dir)) {
      mkdir($dir, 0777, true);
    }

    if (is_uploaded_file($source)) {
      $res = @move_uploaded_file($source, $dest);
    } else {
      $res = @copy($source, $dest);
    }

    if (!$res) {
      $err = error_get_last();

      Exception::ThrowError(Exception::PROCESSING_FILE, $err['message']);
    }
  }
427145
public function move($dest)
    { 
		$tree = new CDBTree('dir_structure');
        $prntid = self::getDbConnection()->fetchColumn('select id from dir_structure where data_id=?', array($dest));
        $strid = self::getDbConnection()->fetchColumn('select id from dir_structure where data_id=?', array($this->id));
		$tree->moveAll($strid, $prntid); 
		
        $this->_url = false;
        $this->_fullUrl = false;
        $this->_treePath = false;
        $this->_path = false;
         
        $this->updateCache();
    }
407810
static function rename($src, $dest) {
        if (self::exists($dest)) {
            throw new \Lollipop\Exception\Runtime('File already exists: ' . $dest);
        }
        
        if (is_uploaded_file($src)) {
            return \move_uploaded_file($src, $dest);
        }
        
        return \rename($src, $dest);
    }
704196
public function addMapping(string $src, string $dest): void
	{
		$this->mapper[$src] = $dest;
	}
124892
static function moveFile($source, $target, $overwrite = true)
    {
        if (!file_exists($source)) return false;
        if (file_exists($target) && $overwrite == false) return false;
        elseif (file_exists($target) && $overwrite == true) {
            if (!unlink($target)) return false;
        }
        $targetDir = dirname($target);
        if (!self::createDirectory($targetDir)) return false;
        return rename($source, $target);
    }
789441
public function copy($source, $dest)
    {
        if (!is_dir($source)) {
            $dest = $this->mkdir($dest);
            $files = $this->readDir($source);

            foreach ($files as $file) {
                if (is_dir($source.'/'.$file)) {
                    $this->copy($source.'/'.$file, $dest.'/'.$file);
                } else {
                    copy($source.'/'.$file, $dest.'/'.$file);
                }
            }
        } elseif (is_file($source)) {
            return copy($source, $dest);
        }

        return true;
    }
433051
public function move( $source, $destination ) {

		if ( false === $this->copy( $source, $destination ) ) {
			return false;
		}

		$this->delete( $source );

		return true;
	}
786070
static void move(File src, File dest) throws IOException {
        try {
            Files.move(src.toPath(), dest.toPath());
        } catch (IOException x) {
            throw x;
        } catch (Exception x) {
            throw new IOException(x);
        }
    }
424286
public function make($src, $dest)
    {
        $windows = PlatformHelper::isWindows();

        $src  = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $src);
        $dest = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $dest);

        if ($windows) {
            return exec("mklink /D {$dest} {$src}");
        } else {
            return exec("ln -s {$src} {$dest}");
        }
    }