1TELLDIR(3)                 Linux Programmer's Manual                TELLDIR(3)
2
3
4

NAME

6       telldir - return current location in directory stream
7

SYNOPSIS

9       #include <dirent.h>
10
11       long telldir(DIR *dirp);
12
13   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15       telldir(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
16

DESCRIPTION

18       The telldir() function returns the current location associated with the
19       directory stream dirp.
20

RETURN VALUE

22       On success, the telldir() function returns the current location in  the
23       directory stream.  On error, -1 is returned, and errno is set appropriā€
24       ately.
25

ERRORS

27       EBADF  Invalid directory stream descriptor dirp.
28

CONFORMING TO

30       4.3BSD, POSIX.1-2001.
31

NOTES

33       In glibc up to version 2.1.1, the return type of telldir()  was  off_t.
34       POSIX.1-2001  specifies  long,  and  this  is the type used since glibc
35       2.1.2.
36
37       In early file systems, the value returned by  telldir()  was  a  simple
38       file  offset  within a directory.  Modern file systems use tree or hash
39       structures, rather than flat tables, to represent directories.  On such
40       file  systems,  the value returned by telldir() (and used internally by
41       readdir(3)) is a "cookie" that is used by the implementation to  derive
42       a  position within a directory.  Application programs should treat this
43       strictly as an opaque value, making no assumptions about its contents.
44

SEE ALSO

46       closedir(3),   opendir(3),   readdir(3),   rewinddir(3),    scandir(3),
47       seekdir(3)
48

COLOPHON

50       This  page  is  part of release 3.53 of the Linux man-pages project.  A
51       description of the project, and information about reporting  bugs,  can
52       be found at http://www.kernel.org/doc/man-pages/.
53
54
55
56                                  2013-03-24                        TELLDIR(3)
Impressum