Function accessW [src]
Call from Windows-specific code if you already have a WTF-16LE encoded, null terminated string.
Otherwise use access or accessZ.
Prototype
pub fn accessW(path: [*:0]const u16) windows.GetFileAttributesError!void
Parameters
path: [*:0]const u16
Source
pub fn accessW(path: [*:0]const u16) windows.GetFileAttributesError!void {
const ret = try windows.GetFileAttributesW(path);
if (ret != windows.INVALID_FILE_ATTRIBUTES) {
return;
}
switch (windows.GetLastError()) {
.FILE_NOT_FOUND => return error.FileNotFound,
.PATH_NOT_FOUND => return error.FileNotFound,
.ACCESS_DENIED => return error.AccessDenied,
else => |err| return windows.unexpectedError(err),
}
}