Skip to content

Use rewinddir to count number of files #13

Description

@cxong

In tinydir_open_sorted, a first pass is used to count the number of files, then a second pass actually reads the file info. In between the two passes, tinydir closes and reopens the dir.

This is unnecessary with dirent; there's the rewinddir function which allows going back to the first file. This would also eliminate a race condition where the directory may have changed between the two passes.

Not sure if there's an equivalent for Windows.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions