Returns the path portion of a given URL.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
CFURLobject to examine.
The path of
NULL if the URL cannot be decomposed (doesn't conform to RFC 1808). Ownership follows the create rule. See The Create Rule.
This function does not resolve the URL against its base, nor does it replace percent escape sequences. This function's return value includes any leading slash (giving the path the normal POSIX appearance), if present. If this behavior is not appropriate, use
CFURLCopy whose return value omits any leading slash. You may also want to use the function
CFURLCopy, which returns the URL's path as a file system path for the given path style. If the path is to be passed to file system calls, you may also want to use the function
CFURLGet, which returns a C string.