---
title: "fileStream(fd:automaticClose:)"
framework: applearchive
role: symbol
role_heading: Type Method
path: "applearchive/archivebytestream/filestream(fd:automaticclose:)"
---

# fileStream(fd:automaticClose:)

Creates a stream from an open file descriptor.

## Declaration

```swift
static func fileStream(fd: FileDescriptor, automaticClose: Bool = true) -> ArchiveByteStream?
```

## Parameters

- `fd`: The file descriptor that you have previously opened with open(2).
- `automaticClose`: A Boolean value that specifies whether to close the file descriptor when you close the stream.

## Return Value

Return Value A new archive byte stream.

## See Also

### File Streaming

- [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)
- [withTemporaryFileStream(_:)](applearchive/archivebytestream/withtemporaryfilestream(_:).md)
