[fs.dir.entry.mods]

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

## 31.12 File systems [[filesystems]](filesystems#fs.dir.entry.mods)

### 31.12.10 Class directory_entry [[fs.class.directory.entry]](fs.class.directory.entry#fs.dir.entry.mods)

#### 31.12.10.3 Modifiers [fs.dir.entry.mods]

[ð](#lib:assign,directory_entry)

`void assign(const filesystem::path& p);
void assign(const filesystem::path& p, error_code& ec);
`

[1](#1)

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

*Effects*: Equivalent to *path-object* = p,
then refresh() or refresh(ec), respectively[.](#1.sentence-1)

If an error occurs, the values of any cached attributes are unspecified[.](#1.sentence-2)

[2](#2)

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

*Throws*: As specified in [[fs.err.report]](fs.err.report "31.12.5 Error reporting")[.](#2.sentence-1)

[ð](#lib:replace_filename,directory_entry)

`void replace_filename(const filesystem::path& p);
void replace_filename(const filesystem::path& p, error_code& ec);
`

[3](#3)

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

*Effects*: Equivalent to *path-object*.replace_filename(p),
then refresh() or refresh(ec), respectively[.](#3.sentence-1)

If an error occurs, the values of any cached attributes are unspecified[.](#3.sentence-2)

[4](#4)

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

*Throws*: As specified in [[fs.err.report]](fs.err.report "31.12.5 Error reporting")[.](#4.sentence-1)

[ð](#lib:refresh,directory_entry)

`void refresh();
void refresh(error_code& ec) noexcept;
`

[5](#5)

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

*Effects*: Stores the current values of any cached attributes of the file p resolves to[.](#5.sentence-1)

If an error occurs, an error is reported ([[fs.err.report]](fs.err.report "31.12.5 Error reporting"))
and the values of any cached attributes are unspecified[.](#5.sentence-2)

[6](#6)

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

*Throws*: As specified in [[fs.err.report]](fs.err.report "31.12.5 Error reporting")[.](#6.sentence-1)

[7](#7)

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

[*Note [1](#note-1)*:

Implementations of directory_iterator ([[fs.class.directory.iterator]](fs.class.directory.iterator "31.12.11 Class directory_­iterator"))
are prohibited from directly or indirectly calling the refresh function
as described in [[fs.class.directory.iterator.general]](fs.class.directory.iterator.general "31.12.11.1 General")[.](#7.sentence-1)

â *end note*]
