| ... | @@ -2003,10 +2003,12 @@ pub const Dir = struct { | ... | @@ -2003,10 +2003,12 @@ pub const Dir = struct { |
| 2003 | return os.windows.CreateSymbolicLink(self.fd, sym_link_path_w, target_path_w, flags.is_directory); | 2003 | return os.windows.CreateSymbolicLink(self.fd, sym_link_path_w, target_path_w, flags.is_directory); |
| 2004 | } | 2004 | } |
| 2005 | | 2005 | |
| | 2006 | pub const ReadLinkError = os.ReadLinkError; |
| | 2007 | |
| 2006 | /// Read value of a symbolic link. | 2008 | /// Read value of a symbolic link. |
| 2007 | /// The return value is a slice of `buffer`, from index `0`. | 2009 | /// The return value is a slice of `buffer`, from index `0`. |
| 2008 | /// Asserts that the path parameter has no null bytes. | 2010 | /// 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 { |
| 2010 | if (builtin.os.tag == .wasi and !builtin.link_libc) { | 2012 | if (builtin.os.tag == .wasi and !builtin.link_libc) { |
| 2011 | return self.readLinkWasi(sub_path, buffer); | 2013 | return self.readLinkWasi(sub_path, buffer); |
| 2012 | } | 2014 | } |