Type MethodSystemPackage

    open(_:_:options:permissions:retryOnInterrupt:)

    Opens or creates a file for reading or writing.

    static func open(_ path: FilePath, _ mode: FileDescriptor.AccessMode, options: FileDescriptor.OpenOptions = FileDescriptor.OpenOptions(), permissions: FilePermissions? = nil, retryOnInterrupt: Bool = true) throws -> FileDescriptor

    Parameters

    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 Errno.interrupted. The default is true. Pass false to try only once and throw an error upon interruption.

    Returns

    A file descriptor for the open file

    Overview

    The corresponding C function is open.