open(_:_:options:permissions:retryOnInterrupt:)
Opens or creates a file for reading or writing.
Declaration
static func open(_ path: UnsafePointer<CChar>, _ mode: FileDescriptor.AccessMode, options: FileDescriptor.OpenOptions = FileDescriptor.OpenOptions(), permissions: FilePermissions? = nil, retryOnInterrupt: Bool = true) throws -> FileDescriptorParameters
- path:
The location of the file to open.
- mode:
The read and write access to use.
- options:
The behavior for opening the file.
- permissions:
The file permissions to use for created files.
- retryOnInterrupt:
Whether to retry the open operation if it throws Interrupted. The default is
true. Passfalseto try only once and throw an error upon interruption.
Return Value
A file descriptor for the open file
Discussion
The corresponding C function is open.