<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/XPCArray/subscript(_:)-9c21w",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "s:3XPC8XPCArrayVy6System14FileDescriptorVSgSicip"
  },
  "title" : "subscript(_:)"
}
-->

# subscript(_:)

Get or set a value in this array as a file descriptor.

```
subscript(index: Int) -> FileDescriptor? { get set }
```

## Parameters

`index`

The index at which to get or set the file descriptor.

## Return Value

A file descriptor value or `nil` if no such value was found.

## Overview

A file descriptor passed in will be duplicated so the caller must still
close theirs. A returned file descriptor is owned by the caller so it must be closed.

---

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)