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

# FileFlags

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

```
@frozen struct FileFlags
```

## Overview> Note: Only available on Darwin, FreeBSD, and OpenBSD.

## Topics

### Initializers

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

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

### Instance Properties

[`let rawValue: CInterop.FileFlags`](/documentation/System/FileFlags/rawValue)

The raw C flags.

### Type Properties

[`static var archived: FileFlags`](/documentation/System/FileFlags/archived)

File has been archived.

[`static var compressed: FileFlags`](/documentation/System/FileFlags/compressed)

File is compressed at the file system level.

[`static var dataVault: FileFlags`](/documentation/System/FileFlags/dataVault)

File requires an entitlement for reading and writing.

[`static var dataless: FileFlags`](/documentation/System/FileFlags/dataless)

File is a dataless placeholder (content is stored remotely).

[`static var firmlink: FileFlags`](/documentation/System/FileFlags/firmlink)

File is a firmlink.

[`static var hidden: FileFlags`](/documentation/System/FileFlags/hidden)

File should not be displayed in a GUI.

[`static var noDump: FileFlags`](/documentation/System/FileFlags/noDump)

Do not dump the file during backups.

[`static var opaque: FileFlags`](/documentation/System/FileFlags/opaque)

Directory is opaque when viewed through a union mount.

[`static var restricted: FileFlags`](/documentation/System/FileFlags/restricted)

File requires an entitlement for writing.

[`static var systemAppend: FileFlags`](/documentation/System/FileFlags/systemAppend)

Writes to the file may only append.

[`static var systemImmutable: FileFlags`](/documentation/System/FileFlags/systemImmutable)

File may not be changed.

[`static var systemNoUnlink: FileFlags`](/documentation/System/FileFlags/systemNoUnlink)

File may not be removed or renamed.

[`static var tracked: FileFlags`](/documentation/System/FileFlags/tracked)

File is tracked for the purpose of document IDs.

[`static var userAppend: FileFlags`](/documentation/System/FileFlags/userAppend)

Writes to the file may only append.

[`static var userImmutable: FileFlags`](/documentation/System/FileFlags/userImmutable)

File may not be changed.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

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

[`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)