<!--
{
  "availability" : [
    "macOS: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaExtension",
  "identifier" : "/documentation/MediaExtension/MEByteSource/byteSourceForRelatedFileName(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MediaExtension"
    ],
    "preciseIdentifier" : "c:objc(cs)MEByteSource(im)byteSourceForRelatedFileName:error:"
  },
  "title" : "byteSourceForRelatedFileName(_:)"
}
-->

# byteSourceForRelatedFileName(_:)

Creates a new byte source for a related file.

```
func byteSourceForRelatedFileName(_ fileName: String) throws -> MEByteSource
```

## Parameters

`fileName`

The related file name that exists in the byte source’s parent directory.

## Return Value

A byte source.

## Discussion

Requests creation of a new [`MEByteSource`](/documentation/MediaExtension/MEByteSource) for a file related to the receiving [`MEByteSource`](/documentation/MediaExtension/MEByteSource). Only file names returned by the [`relatedFileNamesInSameDirectory`](/documentation/MediaExtension/MEByteSource/relatedFileNamesInSameDirectory) method may be accessed.

---

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)