<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Pipe/fileHandleForReading",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPipe(py)fileHandleForReading"
  },
  "title" : "fileHandleForReading"
}
-->

# fileHandleForReading

The receiver’s read file handle.

```
var fileHandleForReading: FileHandle { get }
```

## Discussion

The descriptor represented by this object is deleted, and the object itself is automatically deallocated when the receiver is deallocated.

You use the returned file handle to read from the pipe using `NSFileHandle`’s read methods—[`availableData`](/documentation/Foundation/FileHandle/availableData), [`readDataToEndOfFile()`](/documentation/Foundation/FileHandle/readDataToEndOfFile()), and [`readData(ofLength:)`](/documentation/Foundation/FileHandle/readData(ofLength:)).

You don’t need to send [`closeFile()`](/documentation/Foundation/FileHandle/closeFile()) to this object or explicitly release the object after you have finished using it.

---

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)