<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFReadStreamOpen(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFReadStreamOpen"
  },
  "title" : "CFReadStreamOpen(_:)"
}
-->

# CFReadStreamOpen(_:)

Opens a stream for reading.

```
func CFReadStreamOpen(_ stream: CFReadStream!) -> Bool
```

## Parameters

`stream`

The stream to open.

## Return Value

`TRUE` if `stream` was successfully opened, `FALSE` otherwise. If `stream` is not in the [`CFStreamStatus.notOpen`](/documentation/CoreFoundation/CFStreamStatus/notOpen) state, this function returns `FALSE`.

## Discussion

Opening a stream causes it to reserve all the system resources it requires. If the stream can open in the background without blocking, this function always returns `true`. To learn when a background open operation completes, you can either schedule the stream into a run loop with [`CFReadStreamScheduleWithRunLoop(_:_:_:)`](/documentation/CoreFoundation/CFReadStreamScheduleWithRunLoop(_:_:_:)) and wait for the stream’s client (set with [`CFReadStreamSetClient(_:_:_:_:)`](/documentation/CoreFoundation/CFReadStreamSetClient(_:_:_:_:))) to be notified or you can poll the stream using [`CFReadStreamGetStatus(_:)`](/documentation/CoreFoundation/CFReadStreamGetStatus(_:)), waiting for a status of [`CFStreamStatus.open`](/documentation/CoreFoundation/CFStreamStatus/open) or [`CFStreamStatus.error`](/documentation/CoreFoundation/CFStreamStatus/error).

You do not need to wait until a stream has finished opening in the background before calling the [`CFReadStreamRead(_:_:_:)`](/documentation/CoreFoundation/CFReadStreamRead(_:_:_:)) function. The read operation will simply block until the open has completed.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)