[fs.op.resize.file]

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

## 31.12 File systems [[filesystems]](filesystems#fs.op.resize.file)

### 31.12.13 Filesystem operation functions [[fs.op.funcs]](fs.op.funcs#fs.op.resize.file)

#### 31.12.13.34 Resize file [fs.op.resize.file]

[ð](#lib:resize_file)

`void filesystem::resize_file(const path& p, uintmax_t new_size);
void filesystem::resize_file(const path& p, uintmax_t new_size, error_code& ec) noexcept;
`

[1](#1)

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

*Effects*: Causes the size that would be returned by file_size(p) to be
equal to new_size, as if by POSIX truncate[.](#1.sentence-1)

[2](#2)

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

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