<!--
{
  "availability" : [
    "iOS: 14.0 -",
    "iPadOS: 14.0 -",
    "macCatalyst: 14.0 -",
    "macOS: 11.0 -",
    "tvOS: 14.0 -",
    "visionOS: 1.0 -",
    "watchOS: 7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "System",
  "identifier" : "/documentation/System",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "System"
    ],
    "preciseIdentifier" : "System"
  },
  "title" : "System"
}
-->

# System

Perform low-level file operations using type-safe APIs.

## Topics

### Adopting System

[Adopting Swift File Operations](/documentation/System/adopting-file-operations)

Migrate existing C code to Swift, using the file operations provided by the System module.

[Adopting Swift File Options](/documentation/System/adopting-file-options)

Migrate existing C code to Swift, using the file-operation options provided by the System module.

[Adopting Swift Error Constants](/documentation/System/adopting-errno)

Migrate existing C code to Swift, using the error constants provided by the System module.

### Files

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

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

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

### Errors

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

### Protocols

[`protocol MachPortRight`](/documentation/System/MachPortRight)

### Structures

[`struct DeviceID`](/documentation/System/DeviceID)

A Swift wrapper of the C `dev_t` type.

[`struct FileFlags`](/documentation/System/FileFlags)

File-specific flags found in the `st_flags` property of a `stat` struct
or used as input to `chflags()`.

[`struct FileMode`](/documentation/System/FileMode)

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

[`struct FileType`](/documentation/System/FileType)

A file type matching those contained in a C `mode_t`.

[`struct GroupID`](/documentation/System/GroupID)

A Swift wrapper of the C `gid_t` type.

[`struct Inode`](/documentation/System/Inode)

A Swift wrapper of the C `ino_t` type.

[`struct Stat`](/documentation/System/Stat)

A Swift wrapper of the C `stat` struct.

[`struct UserID`](/documentation/System/UserID)

A Swift wrapper of the C `uid_t` type.

### Enumerations

[`enum CInterop`](/documentation/System/CInterop)

A namespace for C and platform types

[`enum Mach`](/documentation/System/Mach)

---

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)