Core Foundation URL Access Utilities Reference

Framework
CoreFoundation/CoreFoundation.h
Declared in
CFURLAccess.h

Overview

Core Foundation URL Access Utilities give you convenient system-independent methods of creating, reading, updating, or deleting a URL resource.

Given a CFURL object that holds either a file or http URL, you can read the resource’s data with the CFURLCreateDataAndPropertiesFromResource function. You can write data to the URL resource, possibly creating a new file, with the CFURLWriteDataAndPropertiesToResource function. Finally, you can destroy, or delete, the resource pointed to by the URL with the CFURLDestroyResource function.

Constants

Error Codes

CFURL error codes.

enum CFURLError {
   kCFURLUnknownError = -10,
   kCFURLUnknownSchemeError = -11,
   kCFURLResourceNotFoundError = -12,
   kCFURLResourceAccessViolationError = -13,
   kCFURLRemoteHostUnavailableError = -14,
   kCFURLImproperArgumentsError = -15,
   kCFURLUnknownPropertyKeyError = -16,
   kCFURLPropertyKeyUnavailableError = -17,
   kCFURLTimeoutError = -18
};
typedef enum CFURLError CFURLError;
Constants
kCFURLUnknownError

Indicates an unknown error.

Available in OS X v10.0 and later.

Declared in CFURLAccess.h.

kCFURLUnknownSchemeError

Indicates that the scheme is not recognized.

Available in OS X v10.0 and later.

Declared in CFURLAccess.h.

kCFURLResourceNotFoundError

Indicates a resource was not found.

Available in OS X v10.0 and later.

Declared in CFURLAccess.h.

kCFURLResourceAccessViolationError

Indicates an error in accessing a resource.

Available in OS X v10.0 and later.

Declared in CFURLAccess.h.

kCFURLRemoteHostUnavailableError

Indicates a remote host is unavailable.

Available in OS X v10.0 and later.

Declared in CFURLAccess.h.

kCFURLImproperArgumentsError

Indicates one or more arguments are improper.

Available in OS X v10.0 and later.

Declared in CFURLAccess.h.

kCFURLUnknownPropertyKeyError

Indicates a property key is unknown.

Available in OS X v10.0 and later.

Declared in CFURLAccess.h.

kCFURLPropertyKeyUnavailableError

Indicates a property key was unavailable.

Available in OS X v10.0 and later.

Declared in CFURLAccess.h.

kCFURLTimeoutError

Indicates a timeout.

Available in OS X v10.0 and later.

Declared in CFURLAccess.h.

Availability
  • Available in OS X version 10.0 and later.
Declared In
CFURLAccess.h

File URL Properties

Properties for file URL resources.

const CFStringRef kCFURLFileExists;
const CFStringRef kCFURLFileDirectoryContents;
const CFStringRef kCFURLFileLength;
const CFStringRef kCFURLFileLastModificationTime;
const CFStringRef kCFURLFilePOSIXMode;
const CFStringRef kCFURLFileOwnerID;
Constants
kCFURLFileExists

A CFBoolean object indicating whether the file referred to by a URL exists.

Available in OS X v10.0 and later.

Deprecated in OS X v10.9.

Declared in CFURLAccess.h.

kCFURLFileDirectoryContents

A CFArray object holding CFURL objects for the contents of a directory referred to by a URL.

Available in OS X v10.0 and later.

Deprecated in OS X v10.9.

Declared in CFURLAccess.h.

kCFURLFileLength

A CFNumber object holding the file’s length in bytes.

Available in OS X v10.0 and later.

Deprecated in OS X v10.9.

Declared in CFURLAccess.h.

kCFURLFileLastModificationTime

A CFDate object holding the file’s modification time.

Available in OS X v10.0 and later.

Deprecated in OS X v10.9.

Declared in CFURLAccess.h.

kCFURLFilePOSIXMode

A CFNumber holding the file’s POSIX mode as given in /usr/include/sys/stat.h.

Available in OS X v10.0 and later.

Deprecated in OS X v10.9.

Declared in CFURLAccess.h.

kCFURLFileOwnerID

A CFNumber holding the file owner's UID.

Available in OS X v10.0 and later.

Deprecated in OS X v10.9.

Declared in CFURLAccess.h.

Availability
  • Available in OS X version 10.0 and later.
Declared In
CFURLAccess.h

HTTP URL Properties

Properties for HTTP URL resources.

const CFStringRef kCFURLHTTPStatusCode;
const CFStringRef kCFURLHTTPStatusLine;
Constants
kCFURLHTTPStatusCode

A CFNumber object holding the status code of an HTTP request.

Available in OS X v10.0 and later.

Deprecated in OS X v10.9.

Declared in CFURLAccess.h.

kCFURLHTTPStatusLine

A CFString object holding the status line of an HTTP request.

Available in OS X v10.0 and later.

Deprecated in OS X v10.9.

Declared in CFURLAccess.h.

Discussion

In addition to the above properties, each field within an HTTP request or response header is itself a property. You can specify a header field by using the field name as the property name.

Availability
  • Available in OS X version 10.0 and later.
Declared In
CFURLAccess.h