[fs.class.file.status]

# 31 Input/output library [[input.output]](./#input.output)

## 31.12 File systems [[filesystems]](filesystems#fs.class.file.status)

### 31.12.9 Class file_status [fs.class.file.status]

#### [31.12.9.1](#general) General [[fs.class.file.status.general]](fs.class.file.status.general)

[ð](#lib:file_status)

namespace std::filesystem {class file_status {public:// [[fs.file.status.cons]](#fs.file.status.cons "31.12.9.2 Constructors"), constructors and destructor file_status() noexcept : file_status(file_type::none) {}explicit file_status(file_type ft,
 perms prms = perms::unknown) noexcept;
 file_status(const file_status&) noexcept = default;
 file_status(file_status&&) noexcept = default; ~file_status(); // assignments file_status& operator=(const file_status&) noexcept = default;
 file_status& operator=(file_status&&) noexcept = default; // [[fs.file.status.mods]](#fs.file.status.mods "31.12.9.4 Modifiers"), modifiersvoid type(file_type ft) noexcept; void permissions(perms prms) noexcept; // [[fs.file.status.obs]](#fs.file.status.obs "31.12.9.3 Observers"), observers file_type type() const noexcept;
 perms permissions() const noexcept; friend bool operator==(const file_status& lhs, const file_status& rhs) noexcept{ return lhs.type() == rhs.type() && lhs.permissions() == rhs.permissions(); }};}

[1](#general-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15970)

An object of type file_status stores information about the type
and permissions of a file[.](#general-1.sentence-1)

#### [31.12.9.2](#fs.file.status.cons) Constructors [[fs.file.status.cons]](fs.file.status.cons)

[ð](#lib:file_status,constructor)

`explicit file_status(file_type ft, perms prms = perms::unknown) noexcept;
`

[1](#fs.file.status.cons-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15981)

*Postconditions*: type() == ft and permissions() == prms[.](#fs.file.status.cons-1.sentence-1)

#### [31.12.9.3](#fs.file.status.obs) Observers [[fs.file.status.obs]](fs.file.status.obs)

[ð](#lib:type,file_status)

`file_type type() const noexcept;
`

[1](#fs.file.status.obs-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15994)

*Returns*: The value of type() specified by the postconditions of the most recent call to a constructor, operator=, or type(file_type) function[.](#fs.file.status.obs-1.sentence-1)

[ð](#lib:permissions,file_status)

`perms permissions() const noexcept;
`

[2](#fs.file.status.obs-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L16006)

*Returns*: The value of permissions() specified by the postconditions of the most recent call to a constructor, operator=, or permissions(perms) function[.](#fs.file.status.obs-2.sentence-1)

#### [31.12.9.4](#fs.file.status.mods) Modifiers [[fs.file.status.mods]](fs.file.status.mods)

[ð](#lib:type,file_status_)

`void type(file_type ft) noexcept;
`

[1](#fs.file.status.mods-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L16020)

*Postconditions*: type() == ft[.](#fs.file.status.mods-1.sentence-1)

[ð](#lib:permissions,file_status_)

`void permissions(perms prms) noexcept;
`

[2](#fs.file.status.mods-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L16031)

*Postconditions*: permissions() == prms[.](#fs.file.status.mods-2.sentence-1)
