stdlib: Use "RelativePath" struct for *at()
POSIX functions in std.os
#11042
Labels
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
standard library
This issue involves writing Zig code for the standard library.
Milestone
Publishing this at @kubkon 's recommendation in #11021 (comment)
That PR introduced
std.os.RelativePathWasi
, which looks like this:Although this only used in the WASI-specific internal functions right now, it seems natural for all of the (slightly) more modern
*at()
POSIX functions:openat
,renameat
,symlinkat
, etc.The idea would be to change these functions to accept
RelativePath
forfd_t
-relative path arguments:This comes with some other small advantages:
fd_t
/[]const u8
/RelativePath
parameters, if desiredcwd().openFile()
style in the "std.fs" interface well - e.g.cwd().getRelativePath(...)
could give you a RelativePath for use with the POSIX-stylestd.os
functionsThe text was updated successfully, but these errors were encountered: