Function

CFReadStreamCreateWithFile

Creates a readable stream for a file.

Declaration

CFReadStreamRef CFReadStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL);

Parameters

alloc

The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

fileURL

The URL of the file to read. The URL must use the file scheme.

Return Value

The new readable stream object, or NULL on failure. Ownership follows the The Create Rule.

Discussion

You must open the stream, using CFReadStreamOpen, before reading from it.

See Also

Creating a Read Stream

CFReadStreamCreateWithBytesNoCopy

Creates a readable stream for a block of memory.