Skip to content

Commit 309c532

Browse files
committed
std.fs: give readLink an explicit error set
1 parent a435298 commit 309c532

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/std/fs.zig

+3-1
Original file line numberDiff line numberDiff line change
@@ -2003,10 +2003,12 @@ pub const Dir = struct {
20032003
return os.windows.CreateSymbolicLink(self.fd, sym_link_path_w, target_path_w, flags.is_directory);
20042004
}
20052005

2006+
pub const ReadLinkError = os.ReadLinkError;
2007+
20062008
/// Read value of a symbolic link.
20072009
/// The return value is a slice of `buffer`, from index `0`.
20082010
/// Asserts that the path parameter has no null bytes.
2009-
pub fn readLink(self: Dir, sub_path: []const u8, buffer: []u8) ![]u8 {
2011+
pub fn readLink(self: Dir, sub_path: []const u8, buffer: []u8) ReadLinkError![]u8 {
20102012
if (builtin.os.tag == .wasi and !builtin.link_libc) {
20112013
return self.readLinkWasi(sub_path, buffer);
20122014
}

0 commit comments

Comments
 (0)