One Logo Pool Ball
System · IOS API REFERENCE

Stat

struct · iOS 27.0+ · SDK 27.1

@frozen struct Stat

A Swift wrapper of the C `stat` struct. - Note: Only available on Unix-like platforms.

Members (47)

get · iOS 27.0+

permissions

TypeScript
getPermissions($self: Stat): FilePermissions
Swift declaration
var permissions: FilePermissions { get set }

File permissions for the given mode - Note: This property is equivalent to `mode.permissions`. Modifying this property will update the underlying `st_mode` accordingly.

set · iOS 27.0+

permissions

TypeScript
setPermissions($self: Stat, value: FilePermissions): void
Swift declaration
var permissions: FilePermissions { get set }

File permissions for the given mode - Note: This property is equivalent to `mode.permissions`. Modifying this property will update the underlying `st_mode` accordingly.

get · iOS 27.0+

st_birthtim

TypeScript
getSt_birthtim($self: Stat): SDKHandle
Swift declaration
var st_birthtim: timespec { get set }

Time of file creation, given as a C `timespec` since the Epoch. The corresponding C property is `st_birthtim` (or `st_birthtimespec` on Darwin). - Note: Only available on Darwin and FreeBSD.

set · iOS 27.0+

st_birthtim

TypeScript
setSt_birthtim($self: Stat, value: SDKHandle): void
Swift declaration
var st_birthtim: timespec { get set }

Time of file creation, given as a C `timespec` since the Epoch. The corresponding C property is `st_birthtim` (or `st_birthtimespec` on Darwin). - Note: Only available on Darwin and FreeBSD.

get · iOS 27.0+

sizeAllocated

TypeScript
getSizeAllocated($self: Stat): number
Swift declaration
var sizeAllocated: Int64 { get }

Total size allocated, in bytes The semantics of this property are tied to the underlying C `st_blocks` field, which can have file-system–dependent behavior. - Note: Calculated as `512 * blocksAllocated`.

get · iOS 27.0+

blocksAllocated

TypeScript
getBlocksAllocated($self: Stat): number
Swift declaration
var blocksAllocated: Int64 { get set }

Number of 512-byte blocks allocated The semantics of this property are tied to the underlying C `st_blocks` field, which can have file-system–dependent behavior. The corresponding C property is `st_blocks`.

set · iOS 27.0+

blocksAllocated

TypeScript
setBlocksAllocated($self: Stat, value: number): void
Swift declaration
var blocksAllocated: Int64 { get set }

Number of 512-byte blocks allocated The semantics of this property are tied to the underlying C `st_blocks` field, which can have file-system–dependent behavior. The corresponding C property is `st_blocks`.

get · iOS 27.0+

specialDeviceID

TypeScript
getSpecialDeviceID($self: Stat): DeviceID
Swift declaration
var specialDeviceID: DeviceID { get set }

Device ID (if special file) For character or block special files, the returned `DeviceID` may have meaningful major and minor values. For non-special files, this property is usually meaningless and often set to 0. The corresponding C property is `st_rdev`.

set · iOS 27.0+

specialDeviceID

TypeScript
setSpecialDeviceID($self: Stat, value: DeviceID): void
Swift declaration
var specialDeviceID: DeviceID { get set }

Device ID (if special file) For character or block special files, the returned `DeviceID` may have meaningful major and minor values. For non-special files, this property is usually meaningless and often set to 0. The corresponding C property is `st_rdev`.

get · iOS 27.0+

generationNumber

TypeScript
getGenerationNumber($self: Stat): number
Swift declaration
var generationNumber: UInt64 { get set }

File generation number The file generation number may be used to distinguish between different files that have used the same inode over time. The corresponding C property is `st_gen`. - Note: Only available on Darwin, FreeBSD, and OpenBSD. The underlying C field is 32-bit on Darwin and OpenBSD, and 64-bit on FreeBSD.

set · iOS 27.0+

generationNumber

TypeScript
setGenerationNumber($self: Stat, value: number): void
Swift declaration
var generationNumber: UInt64 { get set }

File generation number The file generation number may be used to distinguish between different files that have used the same inode over time. The corresponding C property is `st_gen`. - Note: Only available on Darwin, FreeBSD, and OpenBSD. The underlying C field is 32-bit on Darwin and OpenBSD, and 64-bit on FreeBSD.

get · iOS 27.0+

preferredIOBlockSize

TypeScript
getPreferredIOBlockSize($self: Stat): number
Swift declaration
var preferredIOBlockSize: Int { get set }

Block size for file system I/O, in bytes The corresponding C property is `st_blksize`.

set · iOS 27.0+

preferredIOBlockSize

TypeScript
setPreferredIOBlockSize($self: Stat, value: number): void
Swift declaration
var preferredIOBlockSize: Int { get set }

Block size for file system I/O, in bytes The corresponding C property is `st_blksize`.

get · iOS 27.0+

mode

TypeScript
getMode($self: Stat): FileMode
Swift declaration
var mode: FileMode { get set }

File mode The corresponding C property is `st_mode`.

set · iOS 27.0+

mode

TypeScript
setMode($self: Stat, value: FileMode): void
Swift declaration
var mode: FileMode { get set }

File mode The corresponding C property is `st_mode`.

get · iOS 27.0+

size

TypeScript
getSize($self: Stat): number
Swift declaration
var size: Int64 { get set }

Total size, in bytes The semantics of this property are tied to the underlying C `st_size` field, which can have file-system–dependent behavior. For example, this property can return different values for a file's data fork and resource fork, and some file systems report logical size rather than actual disk usage for compressed or cloned files. The corresponding C property is `st_size`.

set · iOS 27.0+

size

TypeScript
setSize($self: Stat, value: number): void
Swift declaration
var size: Int64 { get set }

Total size, in bytes The semantics of this property are tied to the underlying C `st_size` field, which can have file-system–dependent behavior. For example, this property can return different values for a file's data fork and resource fork, and some file systems report logical size rather than actual disk usage for compressed or cloned files. The corresponding C property is `st_size`.

get · iOS 27.0+

type

TypeScript
getType($self: Stat): FileType
Swift declaration
var type: FileType { get set }

File type for the given mode - Note: This property is equivalent to `mode.type`. Modifying this property will update the underlying `st_mode` accordingly.

set · iOS 27.0+

type

TypeScript
setType($self: Stat, value: FileType): void
Swift declaration
var type: FileType { get set }

File type for the given mode - Note: This property is equivalent to `mode.type`. Modifying this property will update the underlying `st_mode` accordingly.

get · iOS 27.0+

flags

TypeScript
getFlags($self: Stat): FileFlags
Swift declaration
var flags: FileFlags { get set }

File flags The corresponding C property is `st_flags`. - Note: Only available on Darwin, FreeBSD, and OpenBSD.

set · iOS 27.0+

flags

TypeScript
setFlags($self: Stat, value: FileFlags): void
Swift declaration
var flags: FileFlags { get set }

File flags The corresponding C property is `st_flags`. - Note: Only available on Darwin, FreeBSD, and OpenBSD.

get · iOS 27.0+

inode

TypeScript
getInode($self: Stat): Inode
Swift declaration
var inode: Inode { get set }

Inode number The corresponding C property is `st_ino`.

set · iOS 27.0+

inode

TypeScript
setInode($self: Stat, value: Inode): void
Swift declaration
var inode: Inode { get set }

Inode number The corresponding C property is `st_ino`.

get · iOS 27.0+

userID

TypeScript
getUserID($self: Stat): UserID
Swift declaration
var userID: UserID { get set }

User ID of owner The corresponding C property is `st_uid`.

set · iOS 27.0+

userID

TypeScript
setUserID($self: Stat, value: UserID): void
Swift declaration
var userID: UserID { get set }

User ID of owner The corresponding C property is `st_uid`.

get · iOS 27.0+

groupID

TypeScript
getGroupID($self: Stat): GroupID
Swift declaration
var groupID: GroupID { get set }

Group ID of owner The corresponding C property is `st_gid`.

set · iOS 27.0+

groupID

TypeScript
setGroupID($self: Stat, value: GroupID): void
Swift declaration
var groupID: GroupID { get set }

Group ID of owner The corresponding C property is `st_gid`.

get · iOS 27.0+

st_atim

TypeScript
getSt_atim($self: Stat): SDKHandle
Swift declaration
var st_atim: timespec { get set }

Time of last access, given as a C `timespec` since the Epoch. The corresponding C property is `st_atim` (or `st_atimespec` on Darwin).

set · iOS 27.0+

st_atim

TypeScript
setSt_atim($self: Stat, value: SDKHandle): void
Swift declaration
var st_atim: timespec { get set }

Time of last access, given as a C `timespec` since the Epoch. The corresponding C property is `st_atim` (or `st_atimespec` on Darwin).

get · iOS 27.0+

st_ctim

TypeScript
getSt_ctim($self: Stat): SDKHandle
Swift declaration
var st_ctim: timespec { get set }

Time of last status (inode) change, given as a C `timespec` since the Epoch. The corresponding C property is `st_ctim` (or `st_ctimespec` on Darwin).

set · iOS 27.0+

st_ctim

TypeScript
setSt_ctim($self: Stat, value: SDKHandle): void
Swift declaration
var st_ctim: timespec { get set }

Time of last status (inode) change, given as a C `timespec` since the Epoch. The corresponding C property is `st_ctim` (or `st_ctimespec` on Darwin).

get · iOS 27.0+

st_mtim

TypeScript
getSt_mtim($self: Stat): SDKHandle
Swift declaration
var st_mtim: timespec { get set }

Time of last modification, given as a C `timespec` since the Epoch. The corresponding C property is `st_mtim` (or `st_mtimespec` on Darwin).

set · iOS 27.0+

st_mtim

TypeScript
setSt_mtim($self: Stat, value: SDKHandle): void
Swift declaration
var st_mtim: timespec { get set }

Time of last modification, given as a C `timespec` since the Epoch. The corresponding C property is `st_mtim` (or `st_mtimespec` on Darwin).

get · iOS 27.0+

deviceID

TypeScript
getDeviceID($self: Stat): DeviceID
Swift declaration
var deviceID: DeviceID { get set }

ID of device containing file The corresponding C property is `st_dev`.

set · iOS 27.0+

deviceID

TypeScript
setDeviceID($self: Stat, value: DeviceID): void
Swift declaration
var deviceID: DeviceID { get set }

ID of device containing file The corresponding C property is `st_dev`.

init · iOS 27.0+

init

TypeScript
initRawValue(rawValue: SDKHandle): Stat
Swift declaration
init(rawValue: CInterop.Stat)

Creates a Swift `Stat` from the raw C struct.

get · iOS 27.0+

rawValue

TypeScript
getRawValue($self: Stat): SDKHandle
Swift declaration
var rawValue: CInterop.Stat

The raw C `stat` struct.

set · iOS 27.0+

rawValue

TypeScript
setRawValue($self: Stat, value: SDKHandle): void
Swift declaration
var rawValue: CInterop.Stat

The raw C `stat` struct.

get · iOS 27.0+

linkCount

TypeScript
getLinkCount($self: Stat): number
Swift declaration
var linkCount: Int { get set }

Number of hard links The corresponding C property is `st_nlink`.

set · iOS 27.0+

linkCount

TypeScript
setLinkCount($self: Stat, value: number): void
Swift declaration
var linkCount: Int { get set }

Number of hard links The corresponding C property is `st_nlink`.

init · iOS 27.0+

init

TypeScript
initRelativeToFlagsRetryOnInterrupt(path: SDKHandle, fd: FileDescriptor, flags: Stat_Flags, retryOnInterrupt?: boolean): Stat
Swift declaration
init(_ path: UnsafePointer<CChar>, relativeTo fd: FileDescriptor, flags: Stat.Flags, retryOnInterrupt: Bool = true) throws(Errno)

Creates a `Stat` struct from an `UnsafePointer<CChar>` path and `Flags`, including a `FileDescriptor` to resolve a relative path. If `path` is absolute (starts with a forward slash), then `fd` is ignored. If `path` is relative, it is resolved against the directory given by `fd`. The corresponding C function is `fstatat()`.

init · iOS 27.0+

init

TypeScript
initRelativeToFlagsRetryOnInterrupt18061(path: FilePath, fd: FileDescriptor, flags: Stat_Flags, retryOnInterrupt?: boolean): Stat
Swift declaration
init(_ path: FilePath, relativeTo fd: FileDescriptor, flags: Stat.Flags, retryOnInterrupt: Bool = true) throws(Errno)

Creates a `Stat` struct from a `FilePath` and `Flags`, including a `FileDescriptor` to resolve a relative path. If `path` is absolute (starts with a forward slash), then `fd` is ignored. If `path` is relative, it is resolved against the directory given by `fd`. The corresponding C function is `fstatat()`.

init · iOS 27.0+

init

TypeScript
initRetryOnInterrupt(fd: FileDescriptor, retryOnInterrupt?: boolean): Stat
Swift declaration
init(_ fd: FileDescriptor, retryOnInterrupt: Bool = true) throws(Errno)

Creates a `Stat` struct from a `FileDescriptor`. The corresponding C function is `fstat()`.

init · iOS 27.0+

init

TypeScript
initFollowTargetSymlinkRetryOnInterrupt(path: SDKHandle, followTargetSymlink?: boolean, retryOnInterrupt?: boolean): Stat
Swift declaration
init(_ path: UnsafePointer<CChar>, followTargetSymlink: Bool = true, retryOnInterrupt: Bool = true) throws(Errno)

Creates a `Stat` struct from an `UnsafePointer<CChar>` path. `followTargetSymlink` determines the behavior if `path` ends with a symbolic link. By default, `followTargetSymlink` is `true` and this initializer behaves like `stat()`. If `followTargetSymlink` is set to `false`, this initializer behaves like `lstat()` and returns information about the symlink itself. The corresponding C function is `stat()` or `lstat()` as described above.

init · iOS 27.0+

init

TypeScript
initFollowTargetSymlinkRetryOnInterrupt95195(path: FilePath, followTargetSymlink?: boolean, retryOnInterrupt?: boolean): Stat
Swift declaration
init(_ path: FilePath, followTargetSymlink: Bool = true, retryOnInterrupt: Bool = true) throws(Errno)

Creates a `Stat` struct from a `FilePath`. `followTargetSymlink` determines the behavior if `path` ends with a symbolic link. By default, `followTargetSymlink` is `true` and this initializer behaves like `stat()`. If `followTargetSymlink` is set to `false`, this initializer behaves like `lstat()` and returns information about the symlink itself. The corresponding C function is `stat()` or `lstat()` as described above.

init · iOS 27.0+

init

TypeScript
initFlagsRetryOnInterrupt(path: SDKHandle, flags: Stat_Flags, retryOnInterrupt?: boolean): Stat
Swift declaration
init(_ path: UnsafePointer<CChar>, flags: Stat.Flags, retryOnInterrupt: Bool = true) throws(Errno)

Creates a `Stat` struct from an `UnsafePointer<CChar>` path and `Flags`. If `path` is relative, it is resolved against the current working directory. The corresponding C function is `fstatat()`.

init · iOS 27.0+

init

TypeScript
initFlagsRetryOnInterrupt43608(path: FilePath, flags: Stat_Flags, retryOnInterrupt?: boolean): Stat
Swift declaration
init(_ path: FilePath, flags: Stat.Flags, retryOnInterrupt: Bool = true) throws(Errno)

Creates a `Stat` struct from a `FilePath` and `Flags`. If `path` is relative, it is resolved against the current working directory. The corresponding C function is `fstatat()`.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

Stat

The iOS SDK compiler rejected this binding: type 'Stat' does not conform to protocol 'OneSDKNamedConstants'

All System types →