tory
file_delete(path(tmp, &quot;my-file.txt&quot;))
dir_ls(tmp)
#&gt; character(0)

# remove the directory
dir_delete(tmp)</code></pre>
<p><strong>fs</strong> is designed to work well with the pipe, though because it is a minimal-dependency infrastructure package it doesn’t provide the pipe itself. You will need to attach <a href="http://magrittr.tidyverse.org">magrittr</a> or similar.</p>
<pre class="r"><code>library(magrittr)

paths &lt;- file_temp() %&gt;%
  dir_create() %&gt;%
  path(letters[1:5]) %&