Skip to content

Conversation

@rovolsw
Copy link

@rovolsw rovolsw commented Oct 6, 2025

Related PR:

This PR features an incremental directory iterator to nob.h.

New functions in this PR:

  • nob_is_dir_empty()
  • nob_dir_iter_open()
  • nob_dir_iter_next()
  • nob_dir_iter_close()
  • nob_dir_iter_getname()

New structure in this PR:

  • Nob_Dir_Iter

Ues cases:

  • Walking directory recusively
  • Deleting directory recusively
  • etc.

Example:

Nob_Dir_Iter iter = {0};
if (nob_dir_iter_open(&iter, "./src")) {
    while (nob_dir_iter_next(&iter)) {
        const char *name = nob_dir_iter_getname(iter);
        // processing
    }
    nob_dir_iter_close(iter);
}

Functions:
- `nob_is_dir_empty()`
- `nob_dir_iter_open()`
- `nob_dir_iter_next()`
- `nob_dir_iter_close()`
- `nob_dir_iter_getname()`
@rovolsw rovolsw marked this pull request as draft October 6, 2025 14:56
@rovolsw rovolsw marked this pull request as ready for review October 6, 2025 15:46
@rovolsw rovolsw mentioned this pull request Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant