TELLDIR(3POSIX)

πŸ’– TELLDIR(3POSIX) πŸ’–

okay bestie, welcome to the POSIX Programmer's Manual β€” this one's telldir, from section 3, and it's literally the chillest little function you'll ever meet ✨


🌸 PROLOG 🌸

okay so first things first, some housekeeping 🫢

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. so like... check before you commit, bestie πŸ’…


πŸ‘‘ NAME πŸ‘‘

telldir β€” current location of a named directory stream 🌈

(it's giving "where are we rn" but for directories, no cap)


✨ SYNOPSIS ✨

#include <dirent.h>

long telldir(DIR *dirp);

look at her. one include, one line, one long. iconic behavior fr fr πŸŽ€


πŸ’œ DESCRIPTION πŸ’œ

okay so the telldir() function shall obtain the current location associated with the directory stream specified by dirp. that's it. that's the whole vibe. she just tells you where you're at πŸ“

and here's the cute part: if the most recent operation on the directory stream was a seekdir(), the directory position returned from the telldir() shall be the same as that supplied as a loc argument for seekdir(). so like, you seeked, and now she tells you back exactly the same spot you gave her. mutual trust. main character energy 🫢


πŸ”₯ RETURN VALUE πŸ”₯

Upon successful completion, telldir() shall return the current location of the specified directory stream. slay πŸ’… that's your number. that's your position. go off queen πŸ‘‘


πŸ’€ ERRORS πŸ’€

No errors are defined. literally nothing can go wrong here (allegedly 😭). she's that stable.

The following sections are informative.


πŸ¦‹ EXAMPLES πŸ¦‹

None.

(she's too powerful for examples, apparently πŸ™ˆ)


πŸ“ APPLICATION USAGE πŸ“

None.


🧚 RATIONALE 🧚

None.


⭐ FUTURE DIRECTIONS ⭐

None.


🌈 SEE ALSO 🌈

  • fdopendir()
  • readdir()
  • seekdir()

The Base Definitions volume of POSIX.1‐2017, <dirent.h>

like yeah, go read the whole squad, they're all connected πŸ’–


Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .

fr fr, if you spot a typo it's probably the conversion's fault, not the Standard's β€” the Standard is the referee document, periodt πŸ’…

and that's a wrap bestie!! πŸŽ€ this page came to you courtesy of IEEE/The Open Group, dated 2017, under the manual name TELLDIR(3POSIX) β€” stay hydrated, keep your directory streams close, and go telldir() responsibly πŸ’–βœ¨πŸ¦‹