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

# FileMode

A strongly-typed file mode representing a C `mode_t`.

```
@frozen struct FileMode
```

## Overview> Note: Only available on Unix-like platforms.

## Topics

### Initializers

[`init(rawValue: CInterop.Mode)`](/documentation/System/FileMode/init(rawValue:))

Creates a strongly-typed `FileMode` from the raw C value.

[`init(type: FileType, permissions: FilePermissions)`](/documentation/System/FileMode/init(type:permissions:))

Creates a `FileMode` from the given file type and permissions.

### Instance Properties

[`var permissions: FilePermissions`](/documentation/System/FileMode/permissions)

The file’s permissions, from the mode’s permission bits.

[`var rawValue: CInterop.Mode`](/documentation/System/FileMode/rawValue)

The raw C mode.

[`var type: FileType`](/documentation/System/FileMode/type)

The file’s type, from the mode’s file-type bits.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Decodable`](/documentation/Swift/Decodable)

[`Equatable`](/documentation/Swift/Equatable)

[`Encodable`](/documentation/Swift/Encodable)

[`Sendable`](/documentation/Swift/Sendable)

[`Copyable`](/documentation/Swift/Copyable)

[`Hashable`](/documentation/Swift/Hashable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)