Zig: add rename to std.fs API

Created on 15 Sep 2020  路  3Comments  路  Source: ziglang/zig

Right now we have std.os.renameat which actually has quite good portability but is in the posix abstraction layer of the standard library. We're missing a higher level abstraction, e.g. in std.fs.Dir or even std.fs itself.

contributor friendly enhancement standard library

All 3 comments

Note that std.fs.rename/std.fs.renameZ/std.fs.renameW already exist (they are just aliases for their std.os.rename counterparts). renameat is not exposed in std.fs, though.

Those should be given proper doc comments and renamed to renameAbsolute etc to follow the pattern of the other functions.

Note also that os.renameat takes fds but the rest of the fs API you are passing around Dir and File

Will have a PR for this later today most likely.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrewrk picture andrewrk  路  3Comments

jorangreef picture jorangreef  路  3Comments

andrewrk picture andrewrk  路  3Comments

bronze1man picture bronze1man  路  3Comments

andrewrk picture andrewrk  路  3Comments