Function chmod [src]

Changes the mode of the directory. The process must have the correct privileges in order to do this successfully, or must have the effective user ID matching the owner of the directory. Additionally, the directory must have been opened with OpenOptions{ .iterate = true }.

Prototype

pub fn chmod(self: Dir, new_mode: File.Mode) ChmodError!void

Parameters

self: Dirnew_mode: File.Mode

Possible Errors

AccessDenied FChmodError
FileNotFound FChmodError
InputOutput FChmodError
PermissionDenied FChmodError
ReadOnlyFileSystem FChmodError
SymLinkLoop FChmodError
SystemResources FChmodError
Unexpected UnexpectedError

The Operating System returned an undocumented error code.

This error is in theory not possible, but it would be better to handle this error than to invoke undefined behavior.

When this error code is observed, it usually means the Zig Standard Library needs a small patch to add the error code to the error set for the respective function.

Source

pub fn chmod(self: Dir, new_mode: File.Mode) ChmodError!void { const file: File = .{ .handle = self.fd }; try file.chmod(new_mode); }