Skip to content

implement ".." (parent directory) for std.fs.Dir.openDir on Windows #3501

Description

@andrewrk

zig/lib/std/fs.zig

Lines 768 to 772 in e839250

if (sub_path_w[0] =='.'andsub_path_w[1] =='.'andsub_path_w[2] ==0) {
// If you're looking to contribute to zig and fix this, see here for an example of how to
// implement this: https://git.midipix.org/ntapi/tree/src/fs/ntapi_tt_open_physical_parent_directory.c
@panic("TODO opening '..' with a relative directory handle is not yet implemented on Windows");
}

example zig code:

conststd=@import("std");
pubfnmain() anyerror!void {
varit=trystd.fs.walkPath(std.heap.direct_allocator, "..");
while (tryit.next()) |entry| {
std.debug.warn("{}\n", entry.path);
}
}
> zig.exe build-exe test.zig
> test.exe TODO opening '..' with a relative directory handle is not yet implemented on Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.os-windowsMicrosoft Windowsstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions