changeMode(_:retryOnInterrupt:)

Sets the permission bits of the open file.

FileDescriptor+Syscalls.swift:90

This declaration is gated by at least one @_spi attribute.

func changeMode(_ mode: FilePermissions, retryOnInterrupt: Bool = true) -> Result<Void, Errno>

Parameters

mode

The permissions to set on the file.

retryOnInterrupt

Whether to retry the operation if it throws Errno.interrupted. The default is true. Pass false to try only once and throw an error upon interruption.

The corresponding C function is fchmod.