Skip to content

Commit 2886a8b

Browse files
mpfaffsqueek502
authored andcommitted
Improve documentation on Dir.realpathW
1 parent f2227ae commit 2886a8b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/std/fs/Dir.zig

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,8 +1428,13 @@ pub fn realpathZ(self: Dir, pathname: [*:0]const u8, out_buffer: []u8) RealPathE
14281428
return result;
14291429
}
14301430

1431-
/// Windows-only. Same as `Dir.realpath` except `pathname` is WTF16 LE encoded.
1432-
/// The result is encoded as WTF16 LE.
1431+
/// Windows-only. Same as `Dir.realpath` except
1432+
/// * `pathname` and the result are WTF-16 LE encoded
1433+
/// * `pathname` is relative or has the NT namespace prefix. See `windows.wToPrefixedFileW` for details.
1434+
///
1435+
/// Additionally, `pathname` will never be accessed after `out_buffer` has been written to, so it
1436+
/// is safe to reuse a single buffer for both.
1437+
///
14331438
/// See also `Dir.realpath`, `realpathW`.
14341439
pub fn realpathW(self: Dir, pathname: []const u16, out_buffer: []u16) RealPathError![]u16 {
14351440
const w = windows;

0 commit comments

Comments
 (0)