Writes the bytes of a property list serialization out to a stream.


CFIndex CFPropertyListWriteToStream(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFStringRef *errorString);



The property list to write out.


The stream to write to. The stream must be opened and configured—this function simply writes bytes to the stream.


A constant that specifies the format used to write propertyList. See CFPropertyListFormat for possible values.


On return, NULL if the conversion is successful, otherwise a string that describes the nature of the errors. Error messages are not localized, but may be in the future, so they are not currently suitable for comparison.

Pass NULL if you do not wish to receive an error string. Ownership follows the The Create Rule.

Return Value

The number of bytes written, or 0 if an error occurred. If 0 is returned, errorString will contain an error message.


This function leaves the stream open after reading the content. When reading a property list, this function expects the reading stream to end wherever the writing ended, so that the end of the property list data can be identified.

Special Considerations

See Also

Exporting a Property List


Returns a CFData object containing a serialized representation of a given property list in a specified format.


Write the bytes of a serialized property list out to a stream.


Creates an XML representation of the specified property list.


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