CPIOArchiveKit Documentation

Enumeration File​Type

public enum FileType: UInt32, Codable, Equatable, CaseIterable  

FileType specifies the type of file in an archive.

Documentation comments are taken from FreeBSD's man pages.

%33 FileType FileType Codable Codable FileType->Codable Equatable Equatable FileType->Equatable UInt32 UInt32 FileType->UInt32 CaseIterable CaseIterable FileType->CaseIterable

Conforms To

CaseIterable
Codable
Equatable
UInt32

Enumeration Cases

set​UID

case setUID = 0o4000

SUID bit.

set​GID

case setGID = 0o2000

SGID bit.

sticky

case sticky = 0o1000

Sticky bit. On some systems, this modifies the behavior of executables and/or directories.

directory

case directory = 0o40000

File type value for directories.

named​Pipe

case namedPipe = 0o10000

File type value for named pipes or FIFOs.

regular

case regular = 0o100000

File type value for regular files.

device

case device = 0o60000

File type value for block special devices.

char​Device

case charDevice = 0o20000

File type value for character special devices.

socket

case socket = 0o140000

File type value for sockets.

type

case type = 0o170000

This masks the file type bits.

if (reader.headers[0].mode.rawValue & FileType.type.rawValue) == FileType.regular.rawValue {
	// reader.headers[0] describes a file.
}

permissions

case permissions = 0o777

The lower 9 bits specify read/write/execute permissions for world, group, and user following standard POSIX conventions.