<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>system | Tidyverse</title><link>https://www.tidyverse.org/tags/system/</link><atom:link href="https://www.tidyverse.org/tags/system/index.xml" rel="self" type="application/rss+xml"/><description>system</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 27 Apr 2026 00:00:00 +0000</lastBuildDate><item><title>processx 3.9.0</title><link>https://www.tidyverse.org/blog/2026/04/processx-3-9-0/</link><pubDate>Mon, 27 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.tidyverse.org/blog/2026/04/processx-3-9-0/</guid><description>&lt;!--
TODO:
* [x] Look over / edit the post's title in the yaml
* [x] Edit (or delete) the description; note this appears in the Twitter card
* [x] Pick category and tags (see existing with [`hugodown::tidy_show_meta()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html))
* [x] Find photo &amp; update yaml metadata
* [x] Create `thumbnail-sq.jpg`; height and width should be equal
* [x] Create `thumbnail-wd.jpg`; width should be >5x height
* [x] [`hugodown::use_tidy_thumbnails()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html)
* [x] Add intro sentence, e.g. the standard tagline for the package
* [x] ~~[`usethis::use_tidy_thanks()`](https://usethis.r-lib.org/reference/use_tidy_thanks.html)~~
-->
&lt;p>We&amp;rsquo;re happy to announce the release of
&lt;a href="https://processx.r-lib.org/" target="_blank" rel="noopener">processx&lt;/a> 3.9.0. processx is an R package to run and manage system processes.&lt;/p>
&lt;p>You can install it from CRAN with:&lt;/p>
&lt;div class="highlight">
&lt;pre class='chroma'>&lt;code class='language-r' data-lang='r'>&lt;span>&lt;span class='nf'>&lt;a href='https://rdrr.io/r/utils/install.packages.html'>install.packages&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"processx"&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;/div>
&lt;p>This blog post discusses the major new features in processx 3.9.0. You can see a full list of changes in the
&lt;a href="https://github.com/r-lib/processx/releases/tag/v3.9.0" target="_blank" rel="noopener">release notes&lt;/a>.&lt;/p>
&lt;h2 id="pipelines">Pipelines
&lt;a href="#pipelines">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h2>&lt;p>New new &lt;code>pipeline&lt;/code> class lets you connect two or more processes with kernel-level pipes, exactly like a Unix shell pipeline (&lt;code>cmd1 | cmd2 | cmd3&lt;/code>): data flows directly between child processes without passing through R.&lt;/p>
&lt;div class="highlight">
&lt;pre class='chroma'>&lt;code class='language-r' data-lang='r'>&lt;span>&lt;span class='nv'>pl&lt;/span> &lt;span class='o'>&amp;lt;-&lt;/span> &lt;span class='nv'>&lt;a href='http://processx.r-lib.org/reference/pipeline.html'>pipeline&lt;/a>&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>new&lt;/span>&lt;span class='o'>(&lt;/span>&lt;/span>
&lt;span> &lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/list.html'>list&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/c.html'>c&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"sort"&lt;/span>&lt;span class='o'>)&lt;/span>, &lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/c.html'>c&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"uniq"&lt;/span>, &lt;span class='s'>"-c"&lt;/span>&lt;span class='o'>)&lt;/span>, &lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/c.html'>c&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"sort"&lt;/span>, &lt;span class='s'>"-rn"&lt;/span>&lt;span class='o'>)&lt;/span>&lt;span class='o'>)&lt;/span>,&lt;/span>
&lt;span> stdin &lt;span class='o'>=&lt;/span> &lt;span class='s'>"|"&lt;/span>,&lt;/span>
&lt;span> stdout &lt;span class='o'>=&lt;/span> &lt;span class='s'>"|"&lt;/span>&lt;/span>
&lt;span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='nv'>pl&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>write_input&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"banana\napple\nbanana\norange\napple\nbanana\n"&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='nv'>pl&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>close_input&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; NULL&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;span>&lt;span class='nv'>pl&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>read_all_output_lines&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] " 3 banana" " 2 apple" " 1 orange"&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;span>&lt;span class='nv'>pl&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>wait&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='nv'>pl&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>get_exit_statuses&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [[1]]&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] 0&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; &lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [[2]]&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] 0&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; &lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [[3]]&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] 0&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;/code>&lt;/pre>
&lt;/div>
&lt;p>The &lt;code>pipeline$new()&lt;/code> constructor takes a list of character vectors &amp;mdash; one per command &amp;mdash; along with the usual &lt;code>stdin&lt;/code>, &lt;code>stdout&lt;/code>, and &lt;code>stderr&lt;/code> arguments. These apply to the &lt;em>ends&lt;/em> of the pipeline: &lt;code>stdin&lt;/code> connects to the first process, &lt;code>stdout&lt;/code> reads from the last, and &lt;code>stderr&lt;/code> controls all processes.&lt;/p>
&lt;p>The key benefit over calling
&lt;a href="http://processx.r-lib.org/reference/run.html" target="_blank" rel="noopener">&lt;code>run()&lt;/code>&lt;/a> in sequence is efficiency: intermediate data never materialises in R. A pipeline processing gigabytes of log lines uses the same small kernel buffers as a shell pipeline would.&lt;/p>
&lt;p>Because each step in the pipeline is a regular &lt;code>process&lt;/code> object under the hood, you can access individual processes via &lt;code>$get_processes()&lt;/code> &amp;mdash; useful for reading per-process stderr or checking exit codes when a stage fails.&lt;/p>
&lt;p>&lt;code>pipeline&lt;/code> works on Unix and Windows and is currently experimental: the API may still change.&lt;/p>
&lt;h2 id="pseudo-terminal-support">Pseudo-terminal support
&lt;a href="#pseudo-terminal-support">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h2>
&lt;h3 id="processxrunpty--true">&lt;code>processx::run(pty = TRUE)&lt;/code>
&lt;a href="#processxrunpty--true">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h3>&lt;p>Many command-line tools behave differently when their output is not connected to a terminal: they disable colour, turn off progress bars, or buffer output more aggressively. The &lt;code>pty = TRUE&lt;/code> option runs a process inside a pseudo-terminal so it sees a real terminal &amp;mdash; colour and interactive behaviour included.&lt;/p>
&lt;p>
&lt;a href="http://processx.r-lib.org/reference/run.html" target="_blank" rel="noopener">&lt;code>run()&lt;/code>&lt;/a> now supports &lt;code>pty = TRUE&lt;/code> directly:&lt;/p>
&lt;div class="highlight">
&lt;pre class='chroma'>&lt;code class='language-r' data-lang='r'>&lt;span>&lt;span class='nv'>out&lt;/span> &lt;span class='o'>&amp;lt;-&lt;/span> &lt;span class='nf'>&lt;a href='http://processx.r-lib.org/reference/run.html'>run&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"ls"&lt;/span>, &lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/c.html'>c&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"--color"&lt;/span>, &lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/path.expand.html'>path.expand&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"~/works/processx"&lt;/span>&lt;span class='o'>)&lt;/span>&lt;span class='o'>)&lt;/span>, pty &lt;span class='o'>=&lt;/span> &lt;span class='kc'>TRUE&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/cat.html'>cat&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='nv'>out&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nv'>stdout&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; DESCRIPTION NAMESPACE README.md &lt;span style='color: #0000BB;'>inst&lt;/span> &lt;span style='color: #0000BB;'>tests&lt;/span>&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; LICENSE NEWS.md _pkgdown.yml &lt;span style='color: #0000BB;'>man&lt;/span> &lt;span style='color: #0000BB;'>tools&lt;/span>&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; LICENSE.md &lt;span style='color: #0000BB;'>R&lt;/span> air.toml processx.Rproj &lt;span style='color: #0000BB;'>vignettes&lt;/span>&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; Makefile README.Rmd codecov.yml &lt;span style='color: #0000BB;'>src&lt;/span>&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;/code>&lt;/pre>
&lt;/div>
&lt;p>When &lt;code>pty = TRUE&lt;/code>, stderr is merged into stdout (the result&amp;rsquo;s &lt;code>$stderr&lt;/code> is always &lt;code>NULL&lt;/code>), because a PTY has a single stream. You can also supply a file path as &lt;code>stdin&lt;/code>; its contents are fed to the process via the PTY master, followed by an EOF signal.&lt;/p>
&lt;h3 id="windows-support">Windows support
&lt;a href="#windows-support">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h3>&lt;p>processx 3.9.0 adds support for pseudo-terminals (PTYs) on Windows, starting from Windows 10 version 1809. The Windows implementation uses the ConPTY API (&lt;code>CreatePseudoConsole&lt;/code>), loaded dynamically so processx continues to load on older Windows and emits a clear error if &lt;code>pty = TRUE&lt;/code> is requested on an unsupported version.&lt;/p>
&lt;h2 id="other-improvements">Other improvements
&lt;a href="#other-improvements">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h2>
&lt;h3 id="new-process-cleanup-article">New process cleanup article
&lt;a href="#new-process-cleanup-article">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h3>&lt;p>A new article,
&lt;a href="https://processx.r-lib.org/articles/cleanup.html" target="_blank" rel="noopener">Process cleanup&lt;/a>, documents all five mechanisms processx provides for ensuring subprocesses don&amp;rsquo;t outlive their intended scope:&lt;/p>
&lt;ol>
&lt;li>Explicit cleanup with
&lt;a href="https://rdrr.io/r/base/on.exit.html" target="_blank" rel="noopener">&lt;code>on.exit()&lt;/code>&lt;/a> &amp;mdash; always deterministic.&lt;/li>
&lt;li>Automatic cleanup on garbage collection (&lt;code>cleanup = TRUE&lt;/code>, the default).&lt;/li>
&lt;li>Process-tree cleanup (&lt;code>cleanup_tree = TRUE&lt;/code>).&lt;/li>
&lt;li>Linux parent-death signal (&lt;code>linux_pdeathsig&lt;/code>) &amp;mdash; Linux only, handles R crashes.&lt;/li>
&lt;li>Supervisor process (&lt;code>supervise = TRUE&lt;/code>) &amp;mdash; all platforms, handles R crashes.&lt;/li>
&lt;/ol>
&lt;h3 id="death-signal-support-on-linux">Death signal support on Linux
&lt;a href="#death-signal-support-on-linux">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h3>&lt;p>On Linux, you can now tell the kernel to deliver a signal to the child process automatically if the parent R process exits &amp;mdash; even if R crashes. Set &lt;code>linux_pdeathsig = TRUE&lt;/code> to send &lt;code>SIGTERM&lt;/code>, or pass an integer signal number directly:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-r" data-lang="r">&lt;span class="n">p&lt;/span> &lt;span class="o">&amp;lt;-&lt;/span> &lt;span class="n">process&lt;/span>&lt;span class="o">$&lt;/span>&lt;span class="nf">new&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;sleep&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s">&amp;#34;100&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">linux_pdeathsig&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">TRUE&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This is useful when you want child processes to clean up after an R crash, without the overhead of running a supervisor. The argument is silently ignored on macOS and Windows.&lt;/p>
&lt;h3 id="record-the-time-when-a-process-exits">Record the time when a process exits
&lt;a href="#record-the-time-when-a-process-exits">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h3>&lt;p>&lt;code>process$get_end_time()&lt;/code> returns the time when the process exited as a &lt;code>POSIXct&lt;/code>, or &lt;code>NULL&lt;/code> if it is still running. This makes it straightforward to measure wall-clock duration without having to record timestamps yourself:&lt;/p>
&lt;div class="highlight">
&lt;pre class='chroma'>&lt;code class='language-r' data-lang='r'>&lt;span>&lt;span class='nv'>p&lt;/span> &lt;span class='o'>&amp;lt;-&lt;/span> &lt;span class='nv'>&lt;a href='http://processx.r-lib.org/reference/process.html'>process&lt;/a>&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>new&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"sleep"&lt;/span>, &lt;span class='s'>"1"&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='nv'>p&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>wait&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='nv'>p&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>get_end_time&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='o'>)&lt;/span> &lt;span class='o'>-&lt;/span> &lt;span class='nv'>p&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nf'>get_start_time&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; Time difference of 1.010295 secs&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;/code>&lt;/pre>
&lt;/div>
&lt;h3 id="append-stdoutstderr-to-files">Append stdout/stderr to files
&lt;a href="#append-stdoutstderr-to-files">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h3>&lt;p>&lt;code>process$new()&lt;/code> and
&lt;a href="http://processx.r-lib.org/reference/run.html" target="_blank" rel="noopener">&lt;code>run()&lt;/code>&lt;/a> now support &lt;code>&amp;quot;&amp;gt;&amp;gt;&amp;quot;&lt;/code> as a prefix for &lt;code>stdout&lt;/code> and &lt;code>stderr&lt;/code> file paths to append output instead of truncating the file:&lt;/p>
&lt;div class="highlight">
&lt;pre class='chroma'>&lt;code class='language-r' data-lang='r'>&lt;span>&lt;span class='nv'>log&lt;/span> &lt;span class='o'>&amp;lt;-&lt;/span> &lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/tempfile.html'>tempfile&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='nf'>&lt;a href='http://processx.r-lib.org/reference/run.html'>run&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"echo"&lt;/span>, args &lt;span class='o'>=&lt;/span> &lt;span class='s'>"first line"&lt;/span>, stdout &lt;span class='o'>=&lt;/span> &lt;span class='nv'>log&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; $status&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] 0&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; &lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; $stdout&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; NULL&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; &lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; $stderr&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] ""&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; &lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; $timeout&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] FALSE&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;span>&lt;span class='nf'>&lt;a href='http://processx.r-lib.org/reference/run.html'>run&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"echo"&lt;/span>, args &lt;span class='o'>=&lt;/span> &lt;span class='s'>"second line"&lt;/span>, stdout &lt;span class='o'>=&lt;/span> &lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/paste.html'>paste0&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"&amp;gt;&amp;gt;"&lt;/span>, &lt;span class='nv'>log&lt;/span>&lt;span class='o'>)&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; $status&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] 0&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; &lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; $stdout&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; NULL&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; &lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; $stderr&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] ""&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; &lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; $timeout&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] FALSE&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;span>&lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/readLines.html'>readLines&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='nv'>log&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] "first line" "second line"&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;/code>&lt;/pre>
&lt;/div>
&lt;p>This is handy when you run the same process repeatedly and want to accumulate output in a single log file.&lt;/p>
&lt;h3 id="binary-standard-output-and-error">Binary standard output and error
&lt;a href="#binary-standard-output-and-error">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h3>&lt;p>
&lt;a href="http://processx.r-lib.org/reference/run.html" target="_blank" rel="noopener">&lt;code>run()&lt;/code>&lt;/a> and &lt;code>process$new()&lt;/code> now support &lt;code>encoding = &amp;quot;binary&amp;quot;&lt;/code> to capture raw bytes. In binary mode,
&lt;a href="http://processx.r-lib.org/reference/run.html" target="_blank" rel="noopener">&lt;code>run()&lt;/code>&lt;/a> returns &lt;code>stdout&lt;/code> and &lt;code>stderr&lt;/code> as raw vectors, and &lt;code>process$read_output()&lt;/code> / &lt;code>process$read_error()&lt;/code> return raw vectors rather than character strings. All bytes are preserved exactly, including null bytes and non-UTF-8 sequences.&lt;/p>
&lt;div class="highlight">
&lt;pre class='chroma'>&lt;code class='language-r' data-lang='r'>&lt;span>&lt;span class='nv'>result&lt;/span> &lt;span class='o'>&amp;lt;-&lt;/span> &lt;span class='nf'>&lt;a href='http://processx.r-lib.org/reference/run.html'>run&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='s'>"cat"&lt;/span>, args &lt;span class='o'>=&lt;/span> &lt;span class='s'>"/bin/ls"&lt;/span>, encoding &lt;span class='o'>=&lt;/span> &lt;span class='s'>"binary"&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/typeof.html'>typeof&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='nv'>result&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nv'>stdout&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] "raw"&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;span>&lt;span class='nf'>&lt;a href='https://rdrr.io/r/base/length.html'>length&lt;/a>&lt;/span>&lt;span class='o'>(&lt;/span>&lt;span class='nv'>result&lt;/span>&lt;span class='o'>$&lt;/span>&lt;span class='nv'>stdout&lt;/span>&lt;span class='o'>)&lt;/span>&lt;/span>
&lt;span>&lt;span class='c'>#&amp;gt; [1] 154624&lt;/span>&lt;/span>
&lt;span>&lt;/span>&lt;/code>&lt;/pre>
&lt;/div>
&lt;p>Two new methods, &lt;code>process$read_output_bytes()&lt;/code> and &lt;code>process$read_error_bytes()&lt;/code>, and the
&lt;a href="http://processx.r-lib.org/reference/processx_connections.html" target="_blank" rel="noopener">&lt;code>conn_read_bytes()&lt;/code>&lt;/a> function, provide direct access to raw bytes from processx connections.&lt;/p>
&lt;h2 id="acknowledgements">Acknowledgements
&lt;a href="#acknowledgements">
&lt;svg class="anchor-symbol" aria-hidden="true" height="26" width="26" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
&lt;path d="M0 0h24v24H0z" fill="currentColor">&lt;/path>
&lt;path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z">&lt;/path>
&lt;/svg>
&lt;/a>
&lt;/h2>&lt;p>Thanks to everyone who contributed to processx 3.9.0 through code, issues, testing, and feedback:&lt;/p>
&lt;p>
&lt;a href="https://github.com/advieser" target="_blank" rel="noopener">@advieser&lt;/a>,
&lt;a href="https://github.com/cderv" target="_blank" rel="noopener">@cderv&lt;/a>,
&lt;a href="https://github.com/chwpearse" target="_blank" rel="noopener">@chwpearse&lt;/a>,
&lt;a href="https://github.com/HenrikBengtsson" target="_blank" rel="noopener">@HenrikBengtsson&lt;/a>,
&lt;a href="https://github.com/king-of-poppk" target="_blank" rel="noopener">@king-of-poppk&lt;/a>,
&lt;a href="https://github.com/r2evans" target="_blank" rel="noopener">@r2evans&lt;/a>,
&lt;a href="https://github.com/sckott" target="_blank" rel="noopener">@sckott&lt;/a>,
&lt;a href="https://github.com/sda030" target="_blank" rel="noopener">@sda030&lt;/a>,
&lt;a href="https://github.com/stupidpupil" target="_blank" rel="noopener">@stupidpupil&lt;/a>, and
&lt;a href="https://github.com/Yunuuuu" target="_blank" rel="noopener">@Yunuuuu&lt;/a>.&lt;/p></description></item></channel></rss>