---
title: "byteSourceForRelatedFileName(_:)"
framework: MediaExtension
role: symbol
role_heading: Instance Method
platforms: [macOS 14.0+]
path: "mediaextension/mebytesource/bytesourceforrelatedfilename(_:)"
---

# byteSourceForRelatedFileName(_:)

Creates a new byte source for a related file.

## Declaration

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

## Parameters

- `fileName`: The related file name that exists in the byte source’s parent directory.

## Return Value

Return Value A byte source.

## Discussion

Discussion Requests creation of a new MEByteSource for a file related to the receiving MEByteSource. Only file names returned by the relatedFileNamesInSameDirectory method may be accessed.

## See Also

### Performing operations on a byte source

- [availableLength(at:)](mediaextension/mebytesource/availablelength(at:).md)
- [read(length:from:completionHandler:)](mediaextension/mebytesource/read(length:from:completionhandler:).md)
