Set the path to a file to write stdout to

@param string $path An absolute file path
@param boolean $append Whether or not to append to the file
@return \sndsgd\Process
321466
public function setStdoutFile(string $path, bool $append = false): Process
    {
        $this->setOutputFile(self::STDOUT, $path, $append);
        return $this;
    }
108625
protected static function appendToPath($path, $file)
    {
        if (empty($file)) return $path;

        return rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $file;
    }
1236031
public function writeFile($content, $append = true, $addNL = true)
	{
		file_put_contents(
			$this->absolute_path,
			($addNL) ? $content . PHP_EOL : $content,
			($append) ? FILE_APPEND | LOCK_EX: LOCK_EX
		);
	}
198983
public static function createFromPath(string $path, $context = null): self
    {
        $file_args = [$path, false];
        $mime_args = [$path, FILEINFO_MIME];
        if (null !== $context) {
            $file_args[] = $context;
            $mime_args[] = $context;
        }

        $content = @file_get_contents(...$file_args);
        if (false === $content) {
            throw new SyntaxError(sprintf('`%s` failed to open stream: No such file or directory', $path));
        }

        return new self(
            str_replace(' ', '', (new finfo(FILEINFO_MIME))->file(...$mime_args))
            .';base64,'.base64_encode($content)
        );
    }
272596
public function optionPath($path)
    {
        $path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);
        $path = PATH_ROOT . str_replace(PATH_ROOT, '', $path);

        if (pathinfo($path, PATHINFO_EXTENSION)) {
            $this->optionFilename(pathinfo($path, PATHINFO_FILENAME));
            $path = dirname($path);
        }

        $this->optionPath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

        return $this;
    }
301967
def append_to_path (path, directory):
    """"""
    if not os.path.isdir(directory) or directory in path:
        return path
    if not path.endswith(os.pathsep):
        path += os.pathsep
    return path + directory
204121
public static void append(Path self, byte[] bytes) throws IOException {
        OutputStream stream = null;
        try {
            stream = Files.newOutputStream(self, CREATE, APPEND);
            stream.write(bytes, 0, bytes.length);
            stream.flush();

            OutputStream temp = stream;
            stream = null;
            temp.close();
        } finally {
            closeWithWarning(stream);
        }
    }
1182138
public static function addPath($path)
    {
        $path = str_replace('//', '/', rtrim($path, '/'));
        if (is_dir($path) && !in_array($path, self::$_paths)) {
            array_unshift(self::$_paths, $path);
        }
    }
1224954
public function appendFile($sourceFilePath)
    {
        // open the new uploaded chunk
        if (!$in = @fopen($sourceFilePath, 'rb')) {
            @fclose($this->destinationFile);
            throw new ChunkSaveException('Failed to open input stream', 101);
        }

        // read and write in buffs
        while ($buff = fread($in, 4096)) {
            fwrite($this->destinationFile, $buff);
        }

        @fclose($in);

        return $this;
    }
478680
public function setOutputPath($path) {
		$dir = pathinfo($path, PATHINFO_DIRNAME);
		$dir = $this->normalizePath($dir);
		
		if (! is_dir($dir)) {
			throw new InvalidPath('Invalid directory: "' . $dir . '"');
		}
		
		if (! is_writable($dir)) {
			throw new InvalidPath('The directory: "' . $dir . '" is unwritable');
		}
		
		if (is_file($path) && ! is_writable($path)) {
			throw new InvalidPath('The File "' . $path . '" exists. but unwritable');
		}
		
		$this->outputFile = $dir . DIRECTORY_SEPARATOR . pathinfo($path, PATHINFO_BASENAME);
		
		return $this;
	}
585815
protected static function append($path)
	{

		if (is_dir($path))
		{

			$env = (is_admin()) ? 'admin' : 'front';

			// from common path
			static::requireFiles($path);

			// from environment path
			static::requireFiles($path."/{$env}");


			return true;

		}

		return false;

	}
1296804
public final static function append(string $source, array $Append): string {
		return self::encode(Arr::append(self::decode($source), $Append));
	}
796236
function addPath($path, $prepend = false)
    {
        $this->write(tap($this->read(), function (&$config) use ($path, $prepend) {
            $method = $prepend ? 'prepend' : 'push';

            $config['paths'] = collect($config['paths'])->{$method}($path)->unique()->all();
        }));
    }
130807
protected function writeFile( string $file, string $data, bool $append = false )
	{
		return $this->write(
			$file, $data, $append
		);
	}
925251
public function setPath($path)
    {
        $this->path = $path;
        $fileFullPath = "{$this->rootPath}/{$this->path}";
        // readable ?
        if (file_exists($fileFullPath)) {
            $this->file = $fileFullPath;
            return $this;
        }
        // absolute path ?
        if (file_exists($path) && strpos($path, $this->rootPath) === 0) {
            $this->file = $path;
            $this->rootPath = '/';
        } else {
            error_log("[BEAR.Ace] 404: {$fileFullPath}");
            throw new Exception('Not found ' . $fileFullPath, 404);
        }

        return $this;
    }
181568
public function write($string, $append = true)
    {
        $mode = $this->getMode($append);
        $this->setHandle($mode);

        return fwrite($this->handle, $string);
    }
151612
public function appendToUploadPath($appendedPath)
    {
        $this->uploadTo = trim($this->uploadTo, '/').'/'.trim($appendedPath, '/').'/';

        return $this;
    }