27 Input/output library [input.output]

27.10 File systems [filesystems]

27.10.15 Filesystem operation functions [fs.op.funcs]

27.10.15.2 Canonical [fs.op.canonical]

path canonical(const path& p, const path& base = current_path()); path canonical(const path& p, error_code& ec); path canonical(const path& p, const path& base, error_code& ec);

Effects: Converts p, which must exist, to an absolute path that has no symbolic link, ".", or ".." elements.

Returns: A path that refers to the same file system object as absolute(p, base). For the overload without a base argument, base is current_path(). Signatures with argument ec return path() if an error occurs.

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

Remarks: !exists(p) is an error.