<!DOCTYPE html><html lang='en'><head><title>[fs.class.file_status]</title><meta charset='UTF-8'/><link rel='stylesheet' type='text/css' href='14882.css'/><link rel='stylesheet' type='text/css' href='expanded.css' title='Notes and examples expanded'/><link rel='alternate stylesheet' type='text/css' href='colored.css' title='Notes and examples colored'/><link rel='alternate stylesheet' type='text/css' href='collapsed.css' title='Notes and examples collapsed'/><link rel='icon' href='icon.png'/></head><body><div class='wrapper'><h1 ><a class='secnum' style='min-width:73pt'>28</a> Input/output library <a class='abbr_ref' href='./#input.output'>[input.output]</a></h1><h2 ><a class='secnum' style='min-width:88pt'>28.11</a> File systems <a class='abbr_ref' href='filesystems#fs.class.file_status'>[filesystems]</a></h2><h3 ><a class='secnum' style='min-width:103pt'>28.11.10</a> Class <span class='texttt'>file_&shy;status</span> <a class='abbr_ref'>[fs.class.file_status]</a></h3><span class='indexparent'><a class='index' id='lib:file_status'></a></span><pre class='codeblock'>
<span class='keyword'>namespace</span> std<span class='operator'>:</span><span class='operator'>:</span>filesystem <span class='curlybracket'>{</span>
  <span class='keyword'>class</span> file_status <span class='curlybracket'>{</span>
  <span class='keyword'>public</span><span class='operator'>:</span>
    <span class='comment'>// <a href='#fs.file_status.cons'>[fs.file_status.cons]</a>, constructors and destructor</span>
    file_status<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span> <span class='operator'>:</span> file_status<span class='parenthesis'>(</span>file_type<span class='operator'>:</span><span class='operator'>:</span>none<span class='parenthesis'>)</span> <span class='curlybracket'>{</span><span class='curlybracket'>}</span>
    <span class='keyword'>explicit</span> file_status<span class='parenthesis'>(</span>file_type ft,
                         perms prms <span class='operator'>=</span> perms<span class='operator'>:</span><span class='operator'>:</span>unknown<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    file_status<span class='parenthesis'>(</span><span class='keyword'>const</span> file_status<span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
    file_status<span class='parenthesis'>(</span>file_status<span class='operator'>&amp;</span><span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
    <span class='operator'>~</span>file_status<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;

    <span class='comment'>// assignments</span>
    file_status<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> file_status<span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
    file_status<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span>file_status<span class='operator'>&amp;</span><span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span> <span class='operator'>=</span> <span class='keyword'>default</span>;

    <span class='comment'>// <a href='#fs.file_status.mods'>[fs.file_status.mods]</a>, modifiers</span>
    <span class='keyword'>void</span>       type<span class='parenthesis'>(</span>file_type ft<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
    <span class='keyword'>void</span>       permissions<span class='parenthesis'>(</span>perms prms<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;

    <span class='comment'>// <a href='#fs.file_status.obs'>[fs.file_status.obs]</a>, observers</span>
    file_type  type<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
    perms      permissions<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
  <span class='curlybracket'>}</span>;
<span class='curlybracket'>}</span>
</pre><div class='para' id='1'><div class='marginalizedparent'><a class='marginalized' href='#1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L13286'>#</a></div><div id='1.sentence-1' class='sentence'>An object of type <span class='texttt'>file_&shy;status</span> stores information about the type
and permissions of a file<a class='hidden_link' href='#1.sentence-1'>.</a></div></div><div id='fs.file_status.cons' class='section'><h4 ><a class='secnum' href='#fs.file_status.cons' style='min-width:118pt'>28.11.10.1</a> Constructors <a class='abbr_ref' href='fs.file_status.cons'>[fs.file_status.cons]</a></h4><span class='indexparent'><a class='index' id='lib:file_status,constructor'></a></span><div class='itemdecl' id='fs.file_status.cons-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.file_status.cons-itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>explicit</span> file_status<span class='parenthesis'>(</span>file_type ft, perms prms <span class='operator'>=</span> perms<span class='operator'>:</span><span class='operator'>:</span>unknown<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.file_status.cons-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.file_status.cons-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L13297'>#</a></div><div id='fs.file_status.cons-1.sentence-1' class='sentence'><span class='textit'>Ensures:</span> <span class='texttt'>type<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> ft</span> and <span class='texttt'>permissions<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> prms</span><a class='hidden_link' href='#fs.file_status.cons-1.sentence-1'>.</a></div></div></div></div><div id='fs.file_status.obs' class='section'><h4 ><a class='secnum' href='#fs.file_status.obs' style='min-width:118pt'>28.11.10.2</a> Observers <a class='abbr_ref' href='fs.file_status.obs'>[fs.file_status.obs]</a></h4><span class='indexparent'><a class='index' id='lib:type,file_status'></a></span><span class='indexparent'><a class='index' id='lib:file_status,type'></a></span><div class='itemdecl' id='fs.file_status.obs-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.file_status.obs-itemdecl:1'>🔗</a></div><code class='itemdeclcode'>file_type type<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.file_status.obs-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.file_status.obs-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L13309'>#</a></div><div id='fs.file_status.obs-1.sentence-1' class='sentence'><span class='textit'>Returns:</span> The value of <span class='texttt'>type<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> specified by the postconditions of the most recent call to a constructor,
  <span class='texttt'><span class='keyword'>operator</span><span class='operator'>=</span></span>, or <span class='texttt'>type<span class='parenthesis'>(</span>file_&shy;type<span class='parenthesis'>)</span></span> function<a class='hidden_link' href='#fs.file_status.obs-1.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:permissions,file_status'></a></span><span class='indexparent'><a class='index' id='lib:file_status,permissions'></a></span><div class='itemdecl' id='fs.file_status.obs-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.file_status.obs-itemdecl:2'>🔗</a></div><code class='itemdeclcode'>perms permissions<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>const</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.file_status.obs-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.file_status.obs-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L13320'>#</a></div><div id='fs.file_status.obs-2.sentence-1' class='sentence'><span class='textit'>Returns:</span> The value of <span class='texttt'>permissions<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span> specified by the postconditions of the most recent call to a constructor,
  <span class='texttt'><span class='keyword'>operator</span><span class='operator'>=</span></span>, or <span class='texttt'>permissions<span class='parenthesis'>(</span>perms<span class='parenthesis'>)</span></span> function<a class='hidden_link' href='#fs.file_status.obs-2.sentence-1'>.</a></div></div></div></div><div id='fs.file_status.mods' class='section'><h4 ><a class='secnum' href='#fs.file_status.mods' style='min-width:118pt'>28.11.10.3</a> Modifiers <a class='abbr_ref' href='fs.file_status.mods'>[fs.file_status.mods]</a></h4><span class='indexparent'><a class='index' id='lib:type,file_status_'></a></span><span class='indexparent'><a class='index' id='lib:file_status,type_'></a></span><div class='itemdecl' id='fs.file_status.mods-itemdecl:1'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.file_status.mods-itemdecl:1'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>void</span> type<span class='parenthesis'>(</span>file_type ft<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.file_status.mods-1'><div class='marginalizedparent'><a class='marginalized' href='#fs.file_status.mods-1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L13333'>#</a></div><div id='fs.file_status.mods-1.sentence-1' class='sentence'><span class='textit'>Ensures:</span> <span class='texttt'>type<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> ft</span><a class='hidden_link' href='#fs.file_status.mods-1.sentence-1'>.</a></div></div></div><span class='indexparent'><a class='index' id='lib:permissions,file_status_'></a></span><span class='indexparent'><a class='index' id='lib:file_status,permissions_'></a></span><div class='itemdecl' id='fs.file_status.mods-itemdecl:2'><div class='marginalizedparent'><a class='itemDeclLink' href='#fs.file_status.mods-itemdecl:2'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>void</span> permissions<span class='parenthesis'>(</span>perms prms<span class='parenthesis'>)</span> <span class='keyword'>noexcept</span>;
</code></div><div class='itemdescr'></div><div class='para' id='fs.file_status.mods-2'><div class='marginalizedparent'><a class='marginalized' href='#fs.file_status.mods-2'>2</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/iostreams.tex#L13343'>#</a></div><div id='fs.file_status.mods-2.sentence-1' class='sentence'><span class='textit'>Ensures:</span> <span class='texttt'>permissions<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span><span class='operator'>=</span> prms</span><a class='hidden_link' href='#fs.file_status.mods-2.sentence-1'>.</a></div></div></div></div></div></body></html>