feature. See also
. The project being documented here (as the example) is the Zig library itself.
Threaded.dirRealPathFileWindows
fn dirRealPathFileWindows(userdata: ?*anyopaque, dir: Dir, sub_path: []const u8, out_buffer: []u8) Dir.RealPathFileError!usize
File
Code
fn dirRealPathFileWindows(userdata: ?*anyopaque, dir: Dir, sub_path: []const u8, out_buffer: []u8) Dir.RealPathFileError!usize {
const t: *Threaded = @ptrCast(@alignCast(userdata));
_ = t;
var path_name_w = try sliceToPrefixedFileW(dir.handle, sub_path, .{});
const h_file = handle: {
if (OpenFile(path_name_w.span(), .{
.dir = dir.handle,
.access_mask = .{
.GENERIC = .{ .READ = true },
.STANDARD = .{ .SYNCHRONIZE = true },
},
.creation = .OPEN,
.filter = .any,
})) |handle| {
break :handle handle;
} else |err| switch (err) {
error.WouldBlock => unreachable,
else => |e| return e,
}
};
defer windows.CloseHandle(h_file);
// we don't need the prefixed path anymore
return realPathWindowsBuf(h_file, out_buffer, &path_name_w.data);
}