zig
zig copied to clipboard
#12474: std.fs.Dir.makeOpenPath: optimize case, if path already exists
Uses a single NtCreateFile syscall on windows, falling back if the parent directory does not exist.
Closes ziglang#12474. Thanks to @joedavis and @matu3ba.
@Vexu Linux jobs are failing due to a formatting issue, I've updated the PR to fix that.
@QusaiHroub would you mind rebasing so that there is not a merge commit in this PR?
@QusaiHroub would you mind rebasing so that there is not a merge commit in this PR?
Done
Thanks!
Since https://github.com/ziglang/zig/pull/16570 has been merged, this can also usepath.ComponentIterator
.
I've made all the necessary changes in my fork here: https://github.com/ziglang/zig/compare/master...squeek502:zig:optimize_std.fs.Dir.makeOpenPath_12474
as well as a few other fixes (fixed leaking intermediate dir handles, reworded the doc comments)
There are a few ways to go here:
- You can rebase your branch on master and cherry pick the commits from my fork
- You can rebase your branch on master and I can submit my changes as a pull request to your branch
- I can submit my branch as a new pull request
Let me know what you'd like to do.
Since #16570 has been merged, this can also use
path.ComponentIterator
.I've made all the necessary changes in my fork here: master...squeek502:zig:optimize_std.fs.Dir.makeOpenPath_12474
as well as a few other fixes (fixed leaking intermediate dir handles, reworded the doc comments)
There are a few ways to go here:
- You can rebase your branch on master and cherry pick the commits from my fork
- You can rebase your branch on master and I can submit my changes as a pull request to your branch
- I can submit my branch as a new pull request
Let me know what you'd like to do.
Thank you for your work, I chose to go the first way, and I did.
Thanks for working on this @QusaiHroub!