---
title: "withTemporaryFileStream(_:)"
framework: applearchive
role: symbol
role_heading: Type Method
path: "applearchive/archivebytestream/withtemporaryfilestream(_:)"
---

# withTemporaryFileStream(_:)

Calls the given closure with a temporary file stream.

## Declaration

```swift
static func withTemporaryFileStream<E>(_ body: (ArchiveByteStream) throws -> E) throws -> E
```

## Parameters

- `body`: A closure with the archive byte stream passed as a parameter.

## Return Value

Return Value The result of the closure.

## See Also

### File Streaming

- [fileStream(fd:automaticClose:)](applearchive/archivebytestream/filestream(fd:automaticclose:).md)
- [withFileStream(fd:automaticClose:_:)](applearchive/archivebytestream/withfilestream(fd:automaticclose:_:).md)
- [fileStream(path:mode:options:permissions:)](applearchive/archivebytestream/filestream(path:mode:options:permissions:).md)
- [withFileStream(path:mode:options:permissions:_:)](applearchive/archivebytestream/withfilestream(path:mode:options:permissions:_:).md)
- [temporaryFileStream()](applearchive/archivebytestream/temporaryfilestream().md)
