Function

CFURLDestroyResource(_:_:)

Destroys a resource indicated by a given URL.

Declaration

func CFURLDestroyResource(_ url: CFURL!, _ errorCode: UnsafeMutablePointer<Int32>!) -> Bool

Parameters

url

The CFURL object of the resource to destroy.

errorCode

On return, 0 if successful, otherwise an error code indicating the nature of the problem. See CFURLError for a list of possible error codes.

Return Value

true if successful, false otherwise.

Discussion

If url uses an http scheme, an http DELETE request is sent to the resource. If url uses a file scheme, then:

  • if the reference is a file, the file is deleted;

  • if the reference is a directory and the directory is empty, the directory is deleted;

  • if the reference is a directory and the directory is not empty, the function returns false and errorCode contains kCFURLUnknownError.

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