# Add rename to std.fs API · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/5e3fa0e94f947c632aa584b9e13bfa2fe241fae1)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 5e3fa0e94f947c632aa584b9e13bfa2fe241fae1

Requested commit: 5e3fa0e94f947c632aa584b9e13bfa2fe241fae1

Commit: 5e3fa0e94f947c632aa584b9e13bfa2fe241fae1

Tree: d2361876d4a8bfe9e5ffab6fc7db81ad33d6ec73

Author: Ryan Liptak

Committer: Andrew Kelley

## Message

```
Add rename to std.fs API

- Moves fs.rename functions to fs.renameAbsolute to match other functions outside of fs.Dir
- Adds fs.Dir.rename that takes two paths relative to the given Dir
- Adds fs.rename that takes two separate Dir's that the given paths are relative to (for renaming across directories without having to make the second path relative to a single directory)
- Fixes FileNotFound error return in std.os.windows.MoveFileExW
- Returns error.RenameAcrossMountPoints from renameatW
  + Matches the RenameAcrossMountPoints error return in renameatWasi/renameatZ

```

## Parents

- [3672a187999c3db6eba35d9a9184e7cc066ed629](https://git.cafe/gitcafe/zig/commit/3672a187999c3db6eba35d9a9184e7cc066ed629?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/5e3fa0e94f947c632aa584b9e13bfa2fe241fae1?format=markdown)
