29 Input/output library [input.output]

29.11 File systems [filesystems]

29.11.13 Filesystem operation functions [fs.op.funcs]

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

file_time_type last_write_time(const path& p); file_time_type last_write_time(const path& p, error_code& ec) noexcept;
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.
Throws: As specified in [fs.err.report].
void last_write_time(const path& p, file_time_type new_time); void last_write_time(const path& p, file_time_type new_time, error_code& ec) noexcept;
Effects: Sets the time of last data modification of the file resolved to by p to new_­time, as if by POSIX futimens().
Throws: As specified in [fs.err.report].
[Note 1:
A postcondition of last_­write_­time(p) == new_­time is not specified since it might not hold for file systems with coarse time granularity.
— end note]