30 Input/output library [input.output]

30.10 File systems [filesystems]

30.10.34 Filesystem operation functions [fs.op.funcs]

30.10.34.12 Equivalent [fs.op.equivalent]

bool equivalent(const path& p1, const path& p2); bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept;

Let s1 and s2 be file_­statuss, determined as if by status(p1) and status(p2), respectively.

Effects: Determines s1 and s2. If (!exists(s1) && !exists(s2)) || (is_­other(s1) && is_­other(s2)) an error is reported ([fs.err.report]).

Returns: true, if s1 == s2 and p1 and p2 resolve to the same file system entity, else false. The signature with argument ec returns false if an error occurs.

Two paths are considered to resolve to the same file system entity if two candidate entities reside on the same device at the same location. This is determined as if by the values of the POSIX stat structure, obtained as if by stat() for the two paths, having equal st_­dev values and equal st_­ino values.

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