Structureswift-nio 2.81.0_NIOFileSystem
Materialization
SystemFileHandle.swift:44This declaration is gated by at least one @_spi attribute.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
struct Materialization
This declaration is gated by at least one @_spi attribute.
struct Materialization
import _NIOFileSystem
A file system library for Swift.
final class SystemFileHandle
An implementation of FileHandleProtocol
which is backed by system calls and a file descriptor.
init(takingOwnershipOf descriptor: FileDescriptor, path: FilePath, materialization: Materialization? = nil, threadPool: NIOThreadPool)
Creates a handle which takes ownership of the provided descriptor.
static func syncOpenWithMaterialization(atPath path: FilePath, mode: FileDescriptor.AccessMode, options originalOptions: FileDescriptor.OpenOptions, permissions: FilePermissions?, threadPool: NIOThreadPool, useTemporaryFileIfPossible: Bool = true) -> Result<SystemFileHandle, FileSystemError>
let sendableView: SendableView
func addPermissions(_ permissions: FilePermissions) async throws -> FilePermissions
func attributeNames() async throws -> [String]
func close() async throws
func close(makeChangesVisible: Bool) async throws
func detachUnsafeFileDescriptor() throws -> FileDescriptor
func info() async throws -> FileInfo
func listContents(recursive: Bool) -> DirectoryEntries
func openDirectory(atPath path: FilePath, options: OpenOptions.Directory) async throws -> SystemFileHandle
func openFile(forReadingAndWritingAt path: FilePath, options: OpenOptions.Write) async throws -> SystemFileHandle
func openFile(forReadingAt path: FilePath, options: OpenOptions.Read) async throws -> SystemFileHandle
func openFile(forWritingAt path: FilePath, options: OpenOptions.Write) async throws -> SystemFileHandle
func readChunk(fromAbsoluteOffset offset: Int64, length: ByteCount) async throws -> ByteBuffer
func readChunks(in range: Range<Int64>, chunkLength size: ByteCount) -> FileChunks
func removePermissions(_ permissions: FilePermissions) async throws -> FilePermissions
func removeValueForAttribute(_ name: String) async throws
func replacePermissions(_ permissions: FilePermissions) async throws
func resize(to size: ByteCount) async throws
func setTimes(lastAccess: FileInfo.Timespec?, lastDataModification: FileInfo.Timespec?) async throws
func synchronize() async throws
func updateValueForAttribute(_ bytes: some (Sendable & RandomAccessCollection<UInt8>), attribute name: String) async throws
func valueForAttribute(_ name: String) async throws -> [UInt8]
func withUnsafeDescriptor<R>(_ execute: @escaping (FileDescriptor) throws -> R) async throws -> R where R : Sendable
@discardableResult func write(contentsOf bytes: some (Sequence<UInt8> & Sendable), toAbsoluteOffset offset: Int64) async throws -> Int64
struct SendableView
The file handle may be for a non-seekable file, so it shouldn’t be ‘Sendable’, however, most of the work performed on behalf of the handle is executed in a thread pool which means that its state must be ‘Sendable’.
enum UpdatePermissionsOperation
typealias ReadFileHandle = SystemFileHandle
typealias ReadWriteFileHandle = SystemFileHandle
typealias WriteFileHandle = SystemFileHandle
protocol Sendable