Returns a new file path URL that refers to the same resource as a specified URL.
SDKs
- iOS 4.0+
- macOS 10.6+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Foundation
Declaration
CFURLRef CFURLCreateFilePathURL(CFAllocator Ref allocator, CFURLRef url, CFError Ref *error);
Parameters
allocator
The allocator to use to allocate memory for the new
CFURL
object. PassNULL
ork
to use the current default allocator.CFAllocator Default url
The URL.
error
The error that occurred if the URL could not be created.
Return Value
The new file path URL, or NULL
if an error occurs
Discussion
If the original URL is a file reference URL, this function returns a copy of the URL converted to a file path URL. If the original URL is a file path URL, this function returns the original URL. If the original URL is not a file URL, or if the resource is not reachable or no longer exists, this function returns nil
.