Required Instance Methodswift-nio 2.72.0_NIOFileSystem
openFile(forWritingAt:options:)
Opens the file at path
for writing and returns a handle to it.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
func openFile(forWritingAt path: FilePath, options: OpenOptions.Write) async throws -> WriteFileHandle
Parameters
Returns
A write-only handle to the opened file.
If path
is a relative path then it is opened relative to the handle.
See also
func openFile(forReadingAt: FilePath, options: OpenOptions.Read
) async throws -> ReadFileHandle Opens the file at
path
for reading and returns a handle to it.func openFile(forReadingAndWritingAt: FilePath, options: OpenOptions.Write
) async throws -> ReadWriteFileHandle Opens the file at
path
for reading and writing and returns a handle to it.func openDirectory(atPath: FilePath, options: OpenOptions.Directory
) async throws -> Self Opens the directory at
path
and returns a handle to it.
Other requirements
Type members
associatedtype ReadFileHandle
The type of
ReadableFileHandleProtocol
to return when opening files for reading.associatedtype ReadWriteFileHandle
The type of
ReadableAndWritableFileHandleProtocol
to return when opening files for reading and writing.associatedtype WriteFileHandle
The type of
WritableFileHandleProtocol
to return when opening files for writing.
Instance members
func listContents(recursive: Bool
) -> DirectoryEntries Returns an
AsyncSequence
of entries in the open directory.