Structure
FileMode
public struct FileMode: RawRepresentable, Equatable
A FileMode
contains a file's permissions and file type.
Relationships
Conforms To
Equatable
RawRepresentable
Nested Type Aliases
RawValue
public typealias RawValue = UInt32
Initializers
init(rawValue:)
public init(rawValue: UInt32)
init(_:modes:)
public init(_ permissions: UInt32, modes: Set<FileType> = [.regular])
Creates a FileMode
.
Parameters
Name | Type | Description |
---|---|---|
permissions | UInt32 |
The UNIX file permissions. |
modes | Set<FileType> |
|
Properties
rawValue
public var rawValue: UInt32
type
public var type: FileType?
The FileType
of self
.
switch header.mode.type {
case .directory: // Directory.
case .regular: // Regular File.
case .symlink: // Symbolic Link.
...
case nil:
// unknown type.
}
rawType
public var rawType: UInt32
The file type bits in self.rawValue
, or, in other words, the raw version of self.type
.