Flags
public struct Flags
Flags
allows to specify additional flags to Mode
, such as permission for file creation.
-
Undocumented
Declaration
Swift
public static let `default`: NIOFileHandle.Flags
-
Allows file creation when opening file for writing. File owner is set to the effective user ID of the process.
Declaration
Swift
public static func allowFileCreation(posixMode: mode_t = S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH) -> Flags
Parameters
posixMode
file mode
applied when file is created. Default permissions are: read and write for fileowner, read for owners group and others. -
Allows the specification of POSIX flags (e.g.
O_TRUNC
) and mode (e.g.S_IWUSR
)Declaration
Swift
public static func posix(flags: CInt, mode: mode_t) -> Flags
Parameters
flags
The POSIX open flags (the second parameter for
open(2)
).mode
The POSIX mode (the third parameter for
open(2)
).Return Value
A
NIOFileHandle.Mode
equivalent to the given POSIX flags and mode.