Function accessW [src]

Same as access except asserts the target OS is Windows and the path parameter is WTF-16 LE encoded null-terminated relative or has the NT namespace prefix TODO currently this ignores flags.

Prototype

pub fn accessW(self: Dir, sub_path_w: [*:0]const u16, flags: File.OpenFlags) AccessError!void

Parameters

self: Dirsub_path_w: [*:0]const u16flags: File.OpenFlags

Possible Errors

AccessDenied AccessError
BadPathName AccessError
FileBusy AccessError
FileNotFound AccessError
InputOutput AccessError
InvalidUtf8 AccessError

WASI-only; file paths must be valid UTF-8.

InvalidWtf8 AccessError

Windows-only; file paths provided by the user must be valid WTF-8. https://simonsapin.github.io/wtf-8/

NameTooLong AccessError
PermissionDenied AccessError
ReadOnlyFileSystem AccessError
SymLinkLoop AccessError
SystemResources AccessError
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 accessW(self: Dir, sub_path_w: [*:0]const u16, flags: File.OpenFlags) AccessError!void { _ = flags; return posix.faccessatW(self.fd, sub_path_w); }