Instance Property

standardizingPath

A URL that points to the same resource as the original URL using an absolute path. (read-only)

Declaration

var standardizingPath: URL? { get }

Discussion

This property only works on URLs with the file: path scheme. For all other URLs, it returns a copy of the original URL.

Like standardizingPath, this property can make the following changes in the provided URL:

  • Expand an initial tilde expression using expandingTildeInPath.

  • Reduce empty components and references to the current directory (that is, the sequences “//” and “/./”) to single path separators.

  • In absolute paths only, resolve references to the parent directory (that is, the component “..”) to the real parent directory if possible using resolvingSymlinksInPath, which consults the file system to resolve each potential symbolic link.

    In relative paths, because symbolic links can’t be resolved, references to the parent directory are left in place.

  • Remove an initial component of “/private” from the path if the result still indicates an existing file or directory (checked by consulting the file system).

Note that the path contained by this property may still have symbolic link components in it. Note also that this property only works with file paths (not, for example, string representations of URLs).