withFileStream(fd:automaticClose:_:)
Calls the given closure with a file stream created from the specified file descriptor.
Declaration
static func withFileStream<E>(fd: FileDescriptor, automaticClose: Bool = true, _ body: (ArchiveByteStream) throws -> E) throws -> EParameters
- fd:
The file descriptor that you have previously opened with
open(2). - automaticClose:
A Boolean value that specifies whether to close the file descriptor when you close the stream.
- body:
A closure with the archive byte stream passed as a parameter.
Return Value
The result of the closure.