One Logo Pool Ball
System · IOS API REFERENCE

FileFlags

struct · iOS 27.0+ · SDK 27.1

@frozen struct FileFlags

File-specific flags found in the `st_flags` property of a `stat` struct or used as input to `chflags()`. - Note: Only available on Darwin, FreeBSD, and OpenBSD.

Members (17)

get · iOS 27.0+

compressed

TypeScript
get compressed(): FileFlags
Swift declaration
static var compressed: FileFlags { get }

File is compressed at the file system level. The corresponding C constant is `UF_COMPRESSED`. - Note: This flag is read-only. Attempting to change it will result in undefined behavior.

get · iOS 27.0+

restricted

TypeScript
get restricted(): FileFlags
Swift declaration
static var restricted: FileFlags { get }

File requires an entitlement for writing. The corresponding C constant is `SF_RESTRICTED`. - Note: This flag may only be changed by the superuser.

get · iOS 27.0+

userAppend

TypeScript
get userAppend(): FileFlags
Swift declaration
static var userAppend: FileFlags { get }

Writes to the file may only append. The corresponding C constant is `UF_APPEND`. - Note: This flag may be changed by the file owner or superuser.

get · iOS 27.0+

systemAppend

TypeScript
get systemAppend(): FileFlags
Swift declaration
static var systemAppend: FileFlags { get }

Writes to the file may only append. The corresponding C constant is `SF_APPEND`. - Note: This flag may only be changed by the superuser.

get · iOS 27.0+

userImmutable

TypeScript
get userImmutable(): FileFlags
Swift declaration
static var userImmutable: FileFlags { get }

File may not be changed. The corresponding C constant is `UF_IMMUTABLE`. - Note: This flag may be changed by the file owner or superuser.

get · iOS 27.0+

systemNoUnlink

TypeScript
get systemNoUnlink(): FileFlags
Swift declaration
static var systemNoUnlink: FileFlags { get }

File may not be removed or renamed. The corresponding C constant is `SF_NOUNLINK`. - Note: This flag may only be changed by the superuser.

get · iOS 27.0+

systemImmutable

TypeScript
get systemImmutable(): FileFlags
Swift declaration
static var systemImmutable: FileFlags { get }

File may not be changed. The corresponding C constant is `SF_IMMUTABLE`. - Note: This flag may only be changed by the superuser.

get · iOS 27.0+

hidden

TypeScript
get hidden(): FileFlags
Swift declaration
static var hidden: FileFlags { get }

File should not be displayed in a GUI. The corresponding C constant is `UF_HIDDEN`. - Note: This flag may be changed by the file owner or superuser.

get · iOS 27.0+

noDump

TypeScript
get noDump(): FileFlags
Swift declaration
static var noDump: FileFlags { get }

Do not dump the file during backups. The corresponding C constant is `UF_NODUMP`. - Note: This flag may be changed by the file owner or superuser.

get · iOS 27.0+

opaque

TypeScript
get opaque(): FileFlags
Swift declaration
static var opaque: FileFlags { get }

Directory is opaque when viewed through a union mount. The corresponding C constant is `UF_OPAQUE`. - Note: This flag may be changed by the file owner or superuser.

get · iOS 27.0+

tracked

TypeScript
get tracked(): FileFlags
Swift declaration
static var tracked: FileFlags { get }

File is tracked for the purpose of document IDs. The corresponding C constant is `UF_TRACKED`. - Note: This flag may be changed by the file owner or superuser.

get · iOS 27.0+

archived

TypeScript
get archived(): FileFlags
Swift declaration
static var archived: FileFlags { get }

File has been archived. The corresponding C constant is `SF_ARCHIVED`. - Note: This flag may only be changed by the superuser.

get · iOS 27.0+

dataless

TypeScript
get dataless(): FileFlags
Swift declaration
static var dataless: FileFlags { get }

File is a dataless placeholder (content is stored remotely). The system will attempt to materialize the file when accessed according to the dataless file materialization policy of the accessing thread or process. See `getiopolicy_np(3)`. The corresponding C constant is `SF_DATALESS`. - Note: This flag is read-only. Attempting to change it will result in undefined behavior.

get · iOS 27.0+

firmlink

TypeScript
get firmlink(): FileFlags
Swift declaration
static var firmlink: FileFlags { get }

File is a firmlink. Firmlinks are used by macOS to create transparent links between the read-only system volume and writable data volume. For example, the `/Applications` folder on the system volume is a firmlink to the `/Applications` folder on the data volume, allowing the user to see both system- and user-installed applications in a single folder. The corresponding C constant is `SF_FIRMLINK`. - Note: This flag may only be changed by the superuser.

init · iOS 27.0+

init

TypeScript
init(rawValue: number): FileFlags
Swift declaration
init(rawValue: CInterop.FileFlags)

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

get · iOS 27.0+

rawValue

TypeScript
getRawValue($self: FileFlags): number
Swift declaration
let rawValue: CInterop.FileFlags

The raw C flags.

get · iOS 27.0+

dataVault

TypeScript
get dataVault(): FileFlags
Swift declaration
static var dataVault: FileFlags { get }

File requires an entitlement for reading and writing. The corresponding C constant is `UF_DATAVAULT`. - Note: This flag may be changed by the file owner or superuser.

Skipped declarations

No declarations were skipped in this snapshot.

All System types →