diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2020-07-13 23:41:06 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2020-07-22 08:51:22 +0200 |
| commit | 49b58153642bbff19ab976b70e329c5592fa1684 (patch) | |
| tree | 7633506ceccb3e25d86c1651c194c7827a549e41 /lib/std/os.zig | |
| parent | 92d11fd4e95b86d6ace166783cda69030647e688 (diff) | |
| download | zig-49b58153642bbff19ab976b70e329c5592fa1684.tar.gz zig-49b58153642bbff19ab976b70e329c5592fa1684.zip | |
Add windows.ReadLink similar to OpenFile but for reparse points only
Diffstat (limited to 'lib/std/os.zig')
| -rw-r--r-- | lib/std/os.zig | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig index eb033babfb..f9c50adc06 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -2393,12 +2393,7 @@ pub const readlinkC = @compileError("deprecated: renamed to readlinkZ"); /// Windows-only. Same as `readlink` except `file_path` is null-terminated, WTF16 encoded. /// See also `readlinkZ`. pub fn readlinkW(file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 { - const handle = windows.OpenFile(file_path, .{ - .access_mask = windows.GENERIC_READ, - .creation = windows.FILE_OPEN, - .options = windows.FILE_OPEN_REPARSE_POINT, - .io_mode = std.io.default_mode, - }) catch |err| { + const handle = windows.ReadLink(file_path) catch |err| { switch (err) { error.IsDir => unreachable, error.NoDevice => return error.FileNotFound, |
