<!--
{
  "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/FileType",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "System"
    ],
    "preciseIdentifier" : "s:6System8FileTypeV"
  },
  "title" : "FileType"
}
-->

# FileType

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

```
@frozen struct FileType
```

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

## Topics

### Initializers

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

Creates a strongly-typed file type from the raw C `mode_t`.

### Instance Properties

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

The raw file-type bits from the C mode.

### Type Properties

[`static var blockSpecial: FileType`](/documentation/System/FileType/blockSpecial)

Block special device

[`static var characterSpecial: FileType`](/documentation/System/FileType/characterSpecial)

Character special device

[`static var directory: FileType`](/documentation/System/FileType/directory)

Directory

[`static var fifo: FileType`](/documentation/System/FileType/fifo)

FIFO (or named pipe)

[`static var regular: FileType`](/documentation/System/FileType/regular)

Regular file

[`static var socket: FileType`](/documentation/System/FileType/socket)

Socket

[`static var symbolicLink: FileType`](/documentation/System/FileType/symbolicLink)

Symbolic link

[`static var whiteout: FileType`](/documentation/System/FileType/whiteout)

Whiteout file

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

---

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)