30 Input/output library [input.output]

30.10 File systems [filesystems]

30.10.30 Class file_­status [fs.class.file_status]

namespace std::filesystem {
  class file_status {
  public:
    // [fs.file_status.cons], 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], modifiers
    void       type(file_type ft) noexcept;
    void       permissions(perms prms) noexcept;

    // [fs.file_status.obs], observers
    file_type  type() const noexcept;
    perms      permissions() const noexcept;
  };
}

An object of type file_­status stores information about the type and permissions of a file.

30.10.30.1 file_­status constructors [fs.file_status.cons]

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

Postconditions: type() == ft and permissions() == prms.

30.10.30.2 file_­status observers [fs.file_status.obs]

file_type type() const noexcept;

Returns: The value of type() specified by the postconditions of the most recent call to a constructor, operator=, or type(file_­type) function.

perms permissions() const noexcept;

Returns: The value of permissions() specified by the postconditions of the most recent call to a constructor, operator=, or permissions(perms) function.

30.10.30.3 file_­status modifiers [fs.file_status.mods]

void type(file_type ft) noexcept;

Postconditions: type() == ft.

void permissions(perms prms) noexcept;

Postconditions: permissions() == prms.