Function

CFURLCopyStrictPath

Returns the path portion of a given URL.

Declaration

CFStringRef CFURLCopyStrictPath(CFURLRef anURL, Boolean *isAbsolute);

Parameters

anURL

The CFURL object to examine.

isAbsolute

On return, indicates whether the path of anURL is absolute.

Return Value

The path of anURL, or NULL if the URL cannot be decomposed (doesn't conform to RFC 1808). Ownership follows the create rule. See The Create Rule.

Discussion

This function does not resolve the URL against its base, nor does it replace percent escape sequences. This function's return value does not include a leading slash and uses isAbsolute to report whether the URL's path is absolute. If this behavior is not appropriate, use the CFURLCopyPath function whose return value includes the leading slash (giving the path the normal POSIX appearance). You may also want to use the CFURLCopyFileSystemPath function, 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 CFURLGetFileSystemRepresentation, which returns a C string.

See Also

Accessing the Parts of a URL

CFURLCanBeDecomposed

Determines if the given URL conforms to RFC 1808 and therefore can be decomposed.

CFURLCopyFileSystemPath

Returns the path portion of a given URL.

CFURLCopyFragment

Returns the fragment from a given URL.

CFURLCopyHostName

Returns the host name of a given URL.

CFURLCopyLastPathComponent

Returns the last path component of a given URL.

CFURLCopyNetLocation

Returns the net location portion of a given URL.

CFURLCopyParameterString

Returns the parameter string from a given URL.

Deprecated
CFURLCopyPassword

Returns the password of a given URL.

CFURLCopyPath

Returns the path portion of a given URL.

CFURLCopyPathExtension

Returns the path extension of a given URL.

CFURLCopyQueryString

Returns the query string of a given URL.

CFURLCopyResourceSpecifier

Returns any additional resource specifiers after the path.

CFURLCopyScheme

Returns the scheme portion of a given URL.

CFURLCopyUserName

Returns the user name from a given URL.

CFURLGetPortNumber

Returns the port number from a given URL.

CFURLHasDirectoryPath

Determines if a given URL's path represents a directory.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software