init(_deprecatedPath:mode:flags:)
Open a new NIOFileHandle
. This operation is blocking.
convenience init(_deprecatedPath path: String, mode: Mode = .read, flags: Flags = .default) throws
Open a new NIOFileHandle
. This operation is blocking.
convenience init(_deprecatedPath path: String, mode: Mode = .read, flags: Flags = .default) throws
s7NIOCore13NIOFileHandleC15_deprecatedPath4mode5flagsACSS_AC4ModeVAC5FlagsVtKcfc
What are these?392ST
import NIOCore
The core abstractions that make up SwiftNIO.
final class NIOFileHandle
Deprecated. NIOFileHandle
is a handle to an open file descriptor.
@frozen struct String
A Unicode string value that is a collection of characters.
struct Mode
Mode
represents file access modes.
struct Flags
Flags
allows to specify additional flags to Mode
, such as permission for file creation.
convenience init(_deprecatedPath path: String) throws
Open a new NIOFileHandle
. This operation is blocking.
init(_deprecatedTakingOwnershipOfDescriptor descriptor: CInt)
Create a NIOFileHandle
taking ownership of descriptor
. You must call NIOFileHandle.close
or NIOFileHandle.takeDescriptorOwnership
before this object can be safely released.
var description: String { get }
var isOpen: Bool { get }
func close() throws
func duplicate() throws -> NIOFileHandle
Duplicates this NIOFileHandle
. This means that a new NIOFileHandle
object with a new underlying file descriptor is returned. The caller takes ownership of the returned NIOFileHandle
and is responsible for closing it.
func takeDescriptorOwnership() throws -> CInt
Take the ownership of the underlying file descriptor. This is similar to close()
but the underlying file descriptor remains open. The caller is responsible for closing the file descriptor by some other means.
func withUnsafeFileDescriptor<T>(_ body: (CInt) throws -> T) throws -> T
convenience init(descriptor: CInt)
Create a NIOFileHandle
taking ownership of descriptor
. You must call NIOFileHandle.close
or NIOFileHandle.takeDescriptorOwnership
before this object can be safely released.
convenience init(path: String) throws
Open a new NIOFileHandle
. This operation is blocking.
convenience init(path: String, mode: Mode = .read, flags: Flags = .default) throws
Open a new NIOFileHandle
. This operation is blocking.