Open System Services Library Calls Reference Manual (G06.27+, H06.04+)
readdir(3) OSS Library Calls Reference Manual
If files are removed from a directory after the most recent call to the opendir() or rewinddir()
function but prior to the first call to the readdir() function, the readdir() function does not
return entries for these files. If files are added to a directory after the most recent call to the
opendir( ) or rewinddir( ) function but prior to the first call to the readdir() function, the read-
dir( ) function returns entries for these files.
The readdir() function retrieves a block of directory entries with each actual read operation and
stores them in a system buffer. The readdir() function marks for update the st_atime field of the
directory each time the directory is actually read.
The first call to the readdir() function after a call to the opendir() or rewinddir() function
retrieves a block of directory entries. The first two entries of the block are for . (dot) and ..(dot-
dot). Therefore, the first entry returned is for . (dot). Each subsequent call to readdir() fetches
another entry from the buffer until the buffer is empty, at which time another block of entries is
automatically retrieved.
If files are added to a directory after a block of entries has been fetched for a readdir() call, no
entries are returned for those files. If files are deleted after a block of entries has been fetched,
entries are returned for those files.
Directory Operations After fork Operations
If, after a call to the fork() or tdm_fork( ) function, both the parent and child processes call the
readdir() function to access an OSS directory, the results of the calls are undefined.
If, after a call to the fork() or tdm_fork( ) function, both the parent and child processes call the
rewinddir( ) function and the readdir() function to access an OSS directory, the results are
undefined.
Use on Guardian Objects
Only disks appear as entries in the /G directory.
A call to opendir() on /G, followed by calls to readdir(), returns all of the Guardian volumes on
the system.
The same sequence performed on /G/vol returns all of the subvolumes and temporary files on that
particular volume.
The same sequence performed on /G/vol/subvol returns all of the files on that particular subvo-
lume, including files that are inaccessible to the OSS interface such as Enscribe structured files
and SQL objects.
The OSS pathnames (relative to /G) returned for Guardian files are in lowercase. The readdir()
function also returns the . (dot) and ..(dot-dot) entries for each directory that has been success-
fully opened.
Use on Objects in /E
For objects in /E that reside on remote HP NonStop server nodes, the d_ino field of the dirent
structure contains the Expand node number of the remote HP NonStop server node containing the
object. The d_ino value for objects in /E that reside on the local node is the pseudo Expand node
number 255.
5−64 Hewlett-Packard Company 527187-004