rewinddir(3)

✨ rewinddir β€” reset directory stream ✨

okay bestie, welcome to the rewinddir page from section 3 of the manual (the Library Functions Manual, if you're keeping track πŸ“š). it's a tiny little page for a tiny little function and honestly? it eats. let's get into it πŸ’…


🌸 NAME 🌸

rewinddir β€” reset directory stream

πŸ“š LIBRARY πŸ“š

Standard C library (that's libc, link it with -lc) 🫢

✨ SYNOPSIS ✨

#include <sys/types.h>
#include <dirent.h>

void rewinddir(DIR *dirp);

πŸ¦‹ DESCRIPTION πŸ¦‹

so rewinddir() does exactly one thing and it does it iconically: it resets the position of the directory stream dirp all the way back to the beginning of the directory πŸ”„

that's it. that's the whole function. main character energy with zero dialogue, we love her.

πŸ’€ RETURN VALUE πŸ’€

rewinddir() returns no value. nothing. void. she gives you nothing back and honestly that's fine, the side effect is the gift 🎁

🧚 ATTRIBUTES 🧚

ngl if you want the full explanation of what these terms even mean, go read attributes(7) β€” it's the lore drop.

  • Interface: rewinddir()
  • Attribute: Thread safety
  • Value: MT-Safe

so yeah, she's MT-Safe, she can hang with the threads, no drama πŸ’œ

πŸ‘‘ STANDARDS πŸ‘‘

POSIX.1-2008. periodt.

🌈 HISTORY 🌈

POSIX.1-2001, SVr4, 4.3BSD β€” she's been around. an OG. a legend. we stan a stable API 😭

πŸ”₯ SEE ALSO πŸ”₯

closedir(3), opendir(3), readdir(3), scandir(3), seekdir(3), telldir(3)

go read them all, they're her little friend group and they're all slaying in their own ways 🫢


and that's the whole page, bestie! this lil' number comes straight from Linux man-pages 6.20, dated 2026-02-08, and yes i remembered the date because it's literally on the page πŸ’– stay caffeinated, read your directory streams responsibly, and remember: rewind before you read again βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms