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

On Windows, when the find directory is finished, the handle is not closed. #8

Closed
actboy168 opened this issue Mar 6, 2019 · 2 comments
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working medium Severity: medium
Milestone

Comments

@actboy168
Copy link
Contributor

Describe the bug
I'm not sure if this meets the C++ standard, but both msvc and mingw implementations do this.

To Reproduce

auto path = fs::path("test/");
fs::create_directory(path);
auto itor = fs::directory_iterator(path);
while (itor != fs::directory_iterator()) {
    ++itor;
}
fs::remove_all(path);
fs::create_directory(path); // throw an exception

When itor is equal to end(), it releases the resources held by itor. fs::create_directory will not throw an exception.

Expected behavior
The second fs::create_directory works fine.

Additional context

@gulrak gulrak added bug Something isn't working medium Severity: medium labels Mar 6, 2019
@gulrak gulrak added this to the v1.0.8 milestone Mar 6, 2019
@gulrak
Copy link
Owner

gulrak commented Mar 6, 2019

Yeah, the standard doesn't specify detailed enough, but that code works on C++17 std::filesystem of GCC8 on macOS and Linux and my own POSIX implementation, so I agree, it should work.

@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Mar 6, 2019
@gulrak
Copy link
Owner

gulrak commented Mar 16, 2019

Closed with release of v1.0.8

@gulrak gulrak closed this as completed Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working medium Severity: medium
Projects
None yet
Development

No branches or pull requests

2 participants