COHERENT manpages

This page displays the COHERENT manpage for telldir() [Return the current position within a directory stream].

List of available manpages
Index


telldir() -- General Function (libc)

Return the current position within a directory stream
off_t telldir (dirp)
DIR *dirp;

The COHERENT function  telldir() is one of a set  of COHERENT routines that
manipulate  directories in  a  device-independent manner.   It returns  the
current position within the directory stream pointed to by dirp.

If an error occurs, telldir() exits and sets errno to an appropriate value.

See Also

closedir(),
dirent.h,
getdents(),
libc,
opendir(),
readdir(),
rewinddir(),
seekdir(),

Notes

The  value returned  by telldir()  should only  be used  as an  argument to
seekdir().

telldir()  and seekdir()  are  unreliable when  directory  stream has  been
closed and  reopened.  It  is best to  avoid using telldir()  and seekdir()
altogether.

Because directory entries can dynamically appear and disappear, and because
directory contents are buffered  by these routines, an application may need
to continually  rescan a directory  to maintain an accurate  picture of its
active entries.

The COHERENT implementation of the dirent routines was written by D. Gwynn.