HP-UX Reference (11i v2 04/09) - 3 Library Functions A-M (vol 6)

d
directory(3C) directory(3C)
return FOUND;
}
}
(void) closedir(dirp);
return NOT_FOUND;
WARNINGS
readdir() and getdirentries()
(see getdirentries(2)) are the only ways to access remote NFS
directories. Attempting to read a remote directory via NFS by using
read() returns -1 and sets errno
to [EISDIR] (see read(2)).
If a file is removed from or added to the directory after the most recent call to
opendir() or rewind-
dir(), whether a subsequent call to readdir()
or readdir_r() returns an entry for that file is
unspecified.
For 32-bit applications, the d_ino field of the
dirent struct may overflow for filesystems that use 64-bit
values. In this case the most-significant bytes will be truncated without generating an error and d_ino
values may not be unique.
APPLICATION USAGE
The header file required for these functions and the type of the return value from
readdir() has been
changed for compatibility with System V Release 3 and the X/Open Portability Guide. See ndir(5) for a
description of the header file
<ndir.h>, which is provided to allow existing HP-UX applications to com-
pile unmodified. <ndir.h> header file is obsoleted starting from HP-UX 10.30 and is available in
/usr/old/usr/include
directory.
New applications should use the
<dirent.h> header file for portability to System V and X/Open sys-
tems. The <ndir.h> header file is obsoleted starting from HP-UX 10.30 and is going to be removed in
future releases.
Users of
readdir_r() should note that readdir_r() now conforms with the POSIX.1c Threads stan-
dard. The old prototype of readdir_r() is supported for compatibility with existing DCE applications
only.
AUTHOR
directory was developed by AT&T, HP, and the University of California, Berkeley.
SEE ALSO
close(2), getdirentries(2), lseek(2), open(2), read(2), dir(4), dirent(5), ndir(5), thread_safety(5).
STANDARDS CONFORMANCE
closedir(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
opendir(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
readdir(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
readdir_r():POSIX.1c
rewinddir(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
seekdir(): AES, SVID3, XPG2, XPG3, XPG4
telldir(): AES, XPG2, XPG3, XPG4
Section 3200 Hewlett-Packard Company 3 HP-UX 11i Version 2: September 2004