zig icon indicating copy to clipboard operation
zig copied to clipboard

#12474: std.fs.Dir.makeOpenPath: optimize case, if path already exists

Open QusaiHroub opened this issue 1 year ago • 4 comments

Uses a single NtCreateFile syscall on windows, falling back if the parent directory does not exist.

Closes ziglang#12474. Thanks to @joedavis and @matu3ba.

QusaiHroub avatar Mar 07 '23 15:03 QusaiHroub

@Vexu Linux jobs are failing due to a formatting issue, I've updated the PR to fix that.

QusaiHroub avatar Mar 10 '23 15:03 QusaiHroub

@QusaiHroub would you mind rebasing so that there is not a merge commit in this PR?

andrewrk avatar Jun 19 '23 18:06 andrewrk

@QusaiHroub would you mind rebasing so that there is not a merge commit in this PR?

Done

QusaiHroub avatar Jun 19 '23 19:06 QusaiHroub

Thanks!

andrewrk avatar Jun 19 '23 19:06 andrewrk

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.

squeek502 avatar Jul 27 '23 21:07 squeek502

Since #16570 has been merged, this can also usepath.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.

QusaiHroub avatar Jul 28 '23 05:07 QusaiHroub

Thanks for working on this @QusaiHroub!

squeek502 avatar Oct 22 '23 05:10 squeek502