<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleArchive",
  "identifier" : "/documentation/AppleArchive/ArchiveByteStream/fileStream(path:mode:options:permissions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Apple Archive",
      "AppleArchive"
    ],
    "preciseIdentifier" : "s:12AppleArchive0B10ByteStreamC04fileD04path4mode7options11permissionsACSg6System8FilePathV_AJ0K10DescriptorV10AccessModeVAN11OpenOptionsVAJ0K11PermissionsVtFZ"
  },
  "title" : "fileStream(path:mode:options:permissions:)"
}
-->

# fileStream(path:mode:options:permissions:)

Opens a new file descriptor using the given path and parameters, and creates a stream from the file descriptor.

```
static func fileStream(path: FilePath, mode: FileDescriptor.AccessMode, options: FileDescriptor.OpenOptions, permissions: FilePermissions) -> ArchiveByteStream?
```

## Parameters

`path`

The file path.

`mode`

The file descriptor access mode.

`options`

The file descriptor options that specify behavior on opening a file.

`permissions`

The file permission bits that govern access to a file.

## Return Value

A new archive byte stream.

---

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)