Contents

CFURLCreateFilePathURL(_:_:_:)

Returns a new file path URL that refers to the same resource as a specified URL.

Declaration

func CFURLCreateFilePathURL(_ allocator: CFAllocator!, _ url: CFURL!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Unmanaged<CFURL>!

Parameters

  • allocator:

    The allocator to use to allocate memory for the new CFURL object. Pass NULL or Kcfallocatordefault to use the current default allocator.

  • 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.

See Also

Creating a CFURL