openFile(forWritingAt:options:)
Open the file at path
for writing.
- 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 writable handle to the opened file.
Errors
Error codes thrown include:
permissionDenied
if you have insufficient permissions to create the file.notFound
ifpath
doesn’t exist andoptions
weren’t set to create a file.
Implementation details
Uses the open(2)
system call.