if exception will be thrown, closedir() will not be closed. E.g. I'd prefer to use cor::on_scope_exit like:
```
    auto closedir_on_exit = cor::on_scope_exit([d]() {
            closedir(d);
        });
```
code is executed on variable destruction.
And the same - for close(fd)