CFURLDestroyResource(_:_:)
Destroys a resource indicated by a given URL.
Declaration
func CFURLDestroyResource(_ url: CFURL!, _ errorCode: UnsafeMutablePointer<Int32>!) -> BoolParameters
- url:
The
CFURLobject of the resource to destroy. - errorCode:
On return,
0if 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
falseanderrorCodecontainskCFURLUnknownError.