Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File/Dir deinit invalidates, close doesn't #10213

Closed
wants to merge 1 commit into from

Commits on Nov 24, 2021

  1. File/Dir deinit invalidates, close doesn't

    Andrew has stated that Zig requires a way to close and invalidate a File.  This PR provides that by adding the "deinit" function to File which will call "close" and then invalidate.  At the same time, I've modified Dir to use the same pattern, where deinit will close and invalidate whereas close will only release the OS resource.  Because Dir did not do this before, zig code was unable to use "const dir" but can now do so with this change.  I've gone through std looking for ".close(" calls and modified the respective Dir or File handles to be const when possible.  To me this makes the code more readable because using const reduces the mental load when reading code.
    marler8997 committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    714e0c6 View commit details
    Browse the repository at this point in the history