Set the destination directory to write the destination file in

@param string $destination_dir The directory path to create the file in
@return self
@throws \InvalidArgumentException if the directory name is not a string (and if $silent==false)
344933
public function setDestinationDir($destination_dir)
    {
        if (is_string($destination_dir)) {
            $destination_dir = realpath($destination_dir);
            if (@file_exists($destination_dir) && @is_dir($destination_dir)) {
                $this->destination_dir = rtrim($destination_dir, '/').'/';
            } elseif (false===$this->silent) {
                throw new \InvalidArgumentException(
                    sprintf('[Compressor] Destination directory "%s" must exist!', $destination_dir)
                );
            }
        } else {
            if (false===$this->silent) {
                throw new \InvalidArgumentException(
                    sprintf('[Compressor] Destination directory must be a string (got "%s")!', gettype($destination_dir))
                );
            }
        }
        return $this;
    }
118745
public function setCacheDir($dir)
    {
        if (!is_dir($dir)) {
            $this->createDir($dir);
        }
        if (!is_writable($dir)) {
            throw new \InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
        }

        $this->cacheDir = $dir;

        return $this;
    }
749321
public function destination($path, $override_chroot = false) {
		// set the path
		$this->Destination = Filesystem::chroot($path, $override_chroot);
		// return self
		return($this);
	}
1373457
public function setDir($dir = null){
        $this->databaseDir = (is_null($dir)) ? realpath(__DIR__).DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR : $dir;
        return $this;
    }
139806
public function setDir($dir)
    {
        if (!is_dir($dir) && !@mkdir($dir, 0755, true)) {
            $message = sprintf('Failed to create directory "%s"', $dir);
            ($e = error_get_last()) && $message .= ': ' . $e['message'];
            throw new \RuntimeException($message);
        }
        $this->dir = realpath($dir);
        return $this;
    }
240452
public function setDirPaths($dir_path)
    {
        if (is_null($dir_path)) {
            $this->setDir($this->getUploadPath());
            $this->setDirPath("");
        } else {
            $this->setDirPath($this->DirTrim($dir_path));
            $this->setDir($this->getUploadPath() . self::DS . $dir_path);
        }

        $path_valid = $this->checkPath($this->getDir());
        if (!$path_valid) {
            $this->setDir($this->getUploadPath());
        }
    }
1026168
public function savePhp5FilesTo($destinationDirectory)
    {
        if ($destinationDirectory === '') {
            throw InvalidParameter::directoryIsRequired();
        }

        if($this->cleanDestinationDirectory){
            $this->removeDirectory($destinationDirectory);
        }

        $this->copyDirectory($this->sourceDirectory, $destinationDirectory);
    }
1187095
public function copyToDirectory($source, $destination)
		{
			//check to make sure the file exists
			if(file_exists($source))
			{
				copy($source,$destination);
			}
			//check to make sure the file exists
			if(file_exists($destination))
			{
				return true;
			} 
			else 
			{
				return false;
			}
		}
1341028
protected function makeDestination($destination)
    {
        if ( ! $this->files->isDirectory($destination)) {
            $this->files->makeDirectory($destination, 0777, true);
        }
    }
363278
def write(site_destination_dir)
      if modified?
        Files.copy_p(path, destination(site_destination_dir))
        @is_modified = false
        true
      else
        false
      end
    end
360743
public function publishDirectory($sourceDir, $destinationDir, $dirName, $force = false)
    {
        if (file_exists($destinationDir) && !$force && !$this->confirmOverwrite($destinationDir)) {
            return;
        }

        File::makeDirectory($destinationDir, 493, true, true);
        File::copyDirectory($sourceDir, $destinationDir);

        $this->comment($dirName.' published');
        $this->info($destinationDir);

        return true;
    }
661666
public static function makeDir($dir) {
		$fs = new Filesystem();
		try {
			$fs->mkdir($dir);
		} catch (IOExceptionInterface $e) {
			Console::writeError("an error occurred while creating your directory at <path>".$e->getPath()."</path>...");
		}
		unset($fs);
	}
637765
public function setDir($dir)
    {
        if (!is_dir($dir)) {
            throw new FileNotFoundException(sprintf('Config "%s" is not a directory.', is_string($dir) ? $dir : (is_object($dir) ? get_class($dir) : gettype($dir))));
        }

        $newDir = realpath($dir).'/';
        if (null === $this->configDirectory) {
            $this->configDirectory = $newDir;

            return $this;
        }

        if ($newDir === $this->configDirectory) {
            return $this;
        }

        $this->configDirectory = $newDir;
        $this->flushAll();

        return $this;
    }
1426
public function copyDirectory( string $directory, string $destination, $options = null ): bool
	{
		if( !$this->isDirectory( $directory ) )
		{
			return false;
		}

		$options = $options ?: FilesystemIterator::SKIP_DOTS;

		// If the destination directory does not actually exist, we will go ahead and
		// create it recursively, which just gets the destination prepared to copy
		// the files over. Once we make the directory we'll proceed the copying.
		if( !$this->isDirectory( $destination ) )
		{
			$this->makeDirectory( $destination, 0777, true );
		}

		$items = new FilesystemIterator( $directory, $options );
		foreach( $items as $item )
		{
			// As we spin through items, we will check to see if the current file is actually
			// a directory or a file. When it is actually a directory we will need to call
			// back into this function recursively to keep copying these nested folders.
			$target = $destination . '/' . $item->getBasename();
			if( $item->isDir() )
			{
				$path = $item->getPathname();
				if( !$this->copyDirectory( $path, $target, $options ) )
				{
					return false;
				}
			}

			// If the current items is just a regular file, we will just copy this to the new
			// location and keep looping. If for some reason the copy fails we'll bail out
			// and return false, so the developer is aware that the copy process failed.
			else
			{
				if( !$this->copy( $item->getPathname(), $target ) )
				{
					return false;
				}
			}
		}

		return true;
	}
85405
public function setTmpDir ($dir)
		{
			$this->_tmpDir = $dir . '/' . $this->_params[ 'identifier' ];
			if (!is_dir($this->_tmpDir))
				FileHelper::createDirectory($this->_tmpDir);
		}
775560
private function createDirectory($directory, $entry_name = NULL)
	{
		$directory = str_replace(DIRECTORY_SEPARATOR, '/', $directory);
		$directory = str_replace('\\', '/', $directory);
		$directory = str_replace('/',  '/', $directory);
		$directory = rtrim($directory, '/\\' . DIRECTORY_SEPARATOR);

		if (!file_exists($directory)) {
			$this->createDirectory(
				pathinfo($directory, PATHINFO_DIRNAME),
				$entry_name
			);

			if (!mkdir($directory)) {
				throw new \Exception(sprintf(
					'Cannot install, failure while creating requisite directory "%s"',
					$directory
				));
			}

		} else {
			if (!is_dir($directory)) {
				throw new \Exception(sprintf(
					'Cannot install, requisite path "%s" exists, but is not a directory',
					$directory
				));
			}

			if (!is_writable($directory)) {
				throw new \Exception(sprintf(
					'Cannot install, requisite directory "%s" is not writable',
					$directory
				));
			}
		}

		$this->map($directory, $entry_name);
	}
1342222
protected function prepareRemoteDirectory($remote_host, $remote_dir)
	{
		$this->log('Initialize remote directory: '. $remote_host .':'. $remote_dir, LOG_INFO, true);

		$output = array();
		$return = null;
		$this->sshExec($remote_host, "mkdir -p $remote_dir", $output, $return, '', '', LOG_DEBUG);

		if (empty($this->data_dirs))
            return;

        $data_dirs = count($this->data_dirs) > 1 ? '{'. implode(',', $this->data_dirs) .'}' : implode(',', $this->data_dirs);

        $cmd = "mkdir -v -m 0775 -p $remote_dir/{$this->data_dir_prefix}/$data_dirs";

        $output = array();
        $return = null;
        $this->sshExec($remote_host, $cmd, $output, $return, '', '', LOG_DEBUG);
	}