pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>path</span>::<span class='ident'>Path</span>;

<span class='kw'>let</span> <span class='ident'>path</span> <span class='op'>=</span> <span class='ident'>Path</span>::<span class='ident'>new</span>(<span class='string'>&quot;/tmp/foo/bar.txt&quot;</span>);
<span class='kw'>let</span> <span class='ident'>file</span> <span class='op'>=</span> <span class='ident'>path</span>.<span class='ident