функция Path::canonicalize

Канонизирует текущий путь

Синтаксис

Path
Path.canonicalize

Возвращаемое значение

Path

Описание

/** * Make a path canonical by dropping segments that are '.', cancelling * segments that are '..' with preceding segments, if possible, * and combining consecutive path separators. Leading '..' segments * are kept on relative paths, and dropped from absolute paths. */

Официальная документация (английский)