Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › Io › Threaded › dirSetFilePermissions Private Function dirSetFilePermissions Doc Source Private Function std.Io.Threaded.dirSetFilePermissions
fn dirSetFilePermissions (
userdata : ?*anyopaque ,
dir : Dir ,
sub_path : []const u8 ,
permissions : Dir .Permissions ,
options : Dir .SetFilePermissionsOptions ,
) Dir .SetFilePermissionsError !void Params userdata : ?*anyopaque dir : Dir sub_path : []const u8 permissions : Dir .Permissions options : Dir .SetFilePermissionsOptions File Io/Threaded.zig: 8446
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464 fn dirSetFilePermissions (
userdata : ?*anyopaque ,
dir : Dir ,
sub_path : []const u8 ,
permissions : Dir .Permissions ,
options : Dir .SetFilePermissionsOptions ,
) Dir .SetFilePermissionsError !void {
if (@sizeOf (Dir .Permissions ) == 0 ) return ;
if (is_windows ) @panic ("TODO implement dirSetFilePermissions windows" );
const t : *Threaded = @ptrCast (@alignCast (userdata ));
var path_buffer : [posix .PATH_MAX ]u8 = undefined ;
const sub_path_posix = try pathToPosix (sub_path , &path_buffer );
const mode = permissions .toMode ();
const flags : u32 = if (!options .follow_symlinks ) posix .AT .SYMLINK_NOFOLLOW else 0 ;
return posixFchmodat (t , dir .handle , sub_path_posix , mode , flags );
}