<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "System",
  "identifier" : "/documentation/System/FilePermissions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "System"
    ],
    "preciseIdentifier" : "s:6System15FilePermissionsV"
  },
  "title" : "FilePermissions"
}
-->

# FilePermissions

The access permissions for a file.

```
@frozen struct FilePermissions
```

## Overview

The following example
creates an instance of the `FilePermissions` structure
from a raw octal literal and compares it
to a file permission created using named options:

```
let perms = FilePermissions(rawValue: 0o644)
perms == [.ownerReadWrite, .groupRead, .otherRead] // true
```

## Topics

### Owner Permissions

[`ownerRead`](/documentation/System/FilePermissions/ownerRead)

Indicates that the owner has read-only permission.

[`ownerWrite`](/documentation/System/FilePermissions/ownerWrite)

Indicates that the owner has write-only permission.

[`ownerExecute`](/documentation/System/FilePermissions/ownerExecute)

Indicates that the owner has execute-only permission.

[`ownerReadWrite`](/documentation/System/FilePermissions/ownerReadWrite)

Indicates that the owner has read-write permission.

[`ownerReadExecute`](/documentation/System/FilePermissions/ownerReadExecute)

Indicates that the owner has read-execute permission.

[`ownerWriteExecute`](/documentation/System/FilePermissions/ownerWriteExecute)

Indicates that the owner has write-execute permission.

[`ownerReadWriteExecute`](/documentation/System/FilePermissions/ownerReadWriteExecute)

Indicates that the owner has read, write, and execute permission.

### Group Permissions

[`groupRead`](/documentation/System/FilePermissions/groupRead)

Indicates that the group has read-only permission.

[`groupWrite`](/documentation/System/FilePermissions/groupWrite)

Indicates that the group has write-only permission.

[`groupExecute`](/documentation/System/FilePermissions/groupExecute)

Indicates that the group has execute-only permission.

[`groupReadWrite`](/documentation/System/FilePermissions/groupReadWrite)

Indicates that the group has read-write permission.

[`groupReadExecute`](/documentation/System/FilePermissions/groupReadExecute)

Indicates that the group has read-execute permission.

[`groupWriteExecute`](/documentation/System/FilePermissions/groupWriteExecute)

Indicates that the group has write-execute permission.

[`groupReadWriteExecute`](/documentation/System/FilePermissions/groupReadWriteExecute)

Indicates that the group has read, write, and execute permission.

### Other Permissions

[`otherRead`](/documentation/System/FilePermissions/otherRead)

Indicates that other users have read-only permission.

[`otherWrite`](/documentation/System/FilePermissions/otherWrite)

Indicates that other users have write-only permission.

[`otherExecute`](/documentation/System/FilePermissions/otherExecute)

Indicates that other users have execute-only permission.

[`otherReadWrite`](/documentation/System/FilePermissions/otherReadWrite)

Indicates that other users have read-write permission.

[`otherReadExecute`](/documentation/System/FilePermissions/otherReadExecute)

Indicates that other users have read-execute permission.

[`otherWriteExecute`](/documentation/System/FilePermissions/otherWriteExecute)

Indicates that other users have write-execute permission.

[`otherReadWriteExecute`](/documentation/System/FilePermissions/otherReadWriteExecute)

Indicates that other users have read, write, and execute permission.

### Special Permissions

[`setUserID`](/documentation/System/FilePermissions/setUserID)

Indicates that the file is executed as the owner.

[`setGroupID`](/documentation/System/FilePermissions/setGroupID)

Indicates that the file is executed as the group.

[`saveText`](/documentation/System/FilePermissions/saveText)

Indicates that executable’s text segment
should be kept in swap space even after it exits.

### Interacting with C APIs

[`init(rawValue:)`](/documentation/System/FilePermissions/init(rawValue:))

Create a strongly-typed file permission from a raw C value.

[`rawValue`](/documentation/System/FilePermissions/rawValue)

The raw C file permissions.

[`CModeT`](/documentation/System/CModeT)

The C `mode_t` type.

### Debugging

[`description`](/documentation/System/FilePermissions/description)

A textual representation of the file permissions.

[`debugDescription`](/documentation/System/FilePermissions/debugDescription)

A textual representation of the file permissions, suitable for debugging.

### Comparing File Permissions

### Encoding File Permissions

### Performing Set Operations



---

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)