-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix compilation errors for fs and fs.Dir #21643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix compilation errors for fs and fs.Dir #21643
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://ziglang.org/documentation/master/std/#std.mem.span seems like the better choice for this
Ok! I can rework it. |
Worth mentioning I got the original pub fn isAbsoluteWindowsW(path_w: [*:0]const u16) bool {
return isAbsoluteWindowsImpl(u16, mem.sliceTo(path_w, 0));
} Should that be changed to: pub fn isAbsoluteWindowsW(path_w: [*:0]const u16) bool {
return isAbsoluteWindowsImpl(u16, mem.span(path_w));
} Ok if that is outside the scope for this PR though |
Ok landed on this pub fn symLinkAbsoluteW(
target_path_w: [*:0]const u16,
sym_link_path_w: [*:0]const u16,
flags: Dir.SymLinkFlags,
) !void {
assert(path.isAbsoluteWindowsW(target_path_w));
assert(path.isAbsoluteWindowsW(sym_link_path_w));
return windows.CreateSymbolicLink(null, mem.span(sym_link_path_w), mem.span(target_path_w), flags.is_directory);
} |
@linusg I switched the sliceTo to mem.span . Think it's ready for another look. |
* fix compilation errors for fs and fs.Dir * mem.span instead of mem.sliceTo * Updating symLinkAbsoluteW function parameters * Update with expected rename semantics
Fixes the std.fs related compiler errors mentioned in #20505