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
CFURLobject. PassNULLor 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
CFURLCopyAbsoluteURL(_:)CFURLCreateAbsoluteURLWithBytes(_:_:_:_:_:_:)CFURLCreateByResolvingBookmarkData(_:_:_:_:_:_:_:)CFURLCreateCopyAppendingPathComponent(_:_:_:_:)CFURLCreateCopyAppendingPathExtension(_:_:_:)CFURLCreateCopyDeletingLastPathComponent(_:_:)CFURLCreateCopyDeletingPathExtension(_:_:)CFURLCreateFileReferenceURL(_:_:_:)CFURLCreateFromFileSystemRepresentation(_:_:_:_:)CFURLCreateFromFileSystemRepresentationRelativeToBase(_:_:_:_:_:)CFURLCreateFromFSRef(_:_:)CFURLCreateWithBytes(_:_:_:_:_:)CFURLCreateWithFileSystemPath(_:_:_:_:)CFURLCreateWithFileSystemPathRelativeToBase(_:_:_:_:_:)CFURLCreateWithString(_:_:_:)