<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPipe"
  },
  "title" : "Pipe"
}
-->

# Pipe

A one-way communications channel between related processes.

```
class Pipe
```

## Overview

[`Pipe`](/documentation/Foundation/Pipe) objects provide an object-oriented interface for accessing pipes. An [`Pipe`](/documentation/Foundation/Pipe) object represents both ends of a pipe and enables communication through the pipe. A pipe is a one-way communications channel between related processes; one process writes data, while the other process reads that data. The data that passes through the pipe is buffered; the size of the buffer is determined by the underlying operating system. [`Pipe`](/documentation/Foundation/Pipe) is an abstract class, the public interface of a class cluster.

## Topics

### Creating an NSPipe Object

[`+  pipe`](/documentation/Foundation/NSPipe/pipe)

Returns an `NSPipe` object.

### Getting the File Handles for a Pipe

[`fileHandleForReading`](/documentation/Foundation/Pipe/fileHandleForReading)

The receiver’s read file handle.

[`fileHandleForWriting`](/documentation/Foundation/Pipe/fileHandleForWriting)

The receiver’s write file handle.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)