Files
cppdraft_translate/cppdraft/fs/op/last/write/time.md
2025-10-25 03:02:53 +03:00

2.2 KiB
Raw Blame History

[fs.op.last.write.time]

31 Input/output library [input.output]

31.12 File systems [filesystems]

31.12.13 Filesystem operation functions [fs.op.funcs]

31.12.13.26 Last write time [fs.op.last.write.time]

🔗

file_time_type filesystem::last_write_time(const path& p); file_time_type filesystem::last_write_time(const path& p, error_code& ec) noexcept;

1

#

Returns: The time of last data modification of p, determined as if by the value of the POSIX stat class member st_mtime obtained as if by POSIX stat.

The signature with argument ec returns file_time_type::min() if an error occurs.

2

#

Throws: As specified in [fs.err.report].

🔗

void filesystem::last_write_time(const path& p, file_time_type new_time); void filesystem::last_write_time(const path& p, file_time_type new_time, error_code& ec) noexcept;

3

#

Effects: Sets the time of last data modification of the file resolved to by p to new_time, as if by POSIX futimens.

4

#

Throws: As specified in [fs.err.report].

5

#

[Note 1:

A postcondition of last_write_time(p) == new_time is not specified because it does not necessarily hold for file systems with coarse time granularity.

— end note]