private function setOutputFile(int $stream, string $path, bool $append)
    {
        if (!is_writable($path)) {
            throw new \InvalidArgumentException(
                "invalid value provided for 'path'; ".
                "'$path' is not a writable file"
            );
        }
        $this->spec[$stream] = ["file", $path, $append === true ? "a" : "w"];
    }