Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

readdir(3) OSS Library Calls Reference Manual
If les are removed from a directory after the most recent call to the opendir() or rewinddir()
function but before the rst call to the readdir() function, the readdir() function does not return
entries for these les. If les are added to a directory after the most recent call to the opendir()
or rewinddir() function but before the rst call to the readdir() function, the readdir() function
returns entries for these les.
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 eld of the
directory each time the directory is actually read.
The rst call to the readdir() function after a call to the opendir() or rewinddir() function
retrieves a block of directory entries. The rst two entries of the block are for . (dot) and ..(dot-
dot). Therefore, the rst 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 les are added to a directory after a block of entries has been fetched for a readdir() call, no
entries are returned for those les. If les are deleted after a block of entries has been fetched,
entries are returned for those les.
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 undened.
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
undened.
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 les on that
particular volume.
The same sequence performed on /G/vol/subvol returns all of the les on that particular subvo-
lume, including les that are inaccessible to the OSS interface such as Enscribe structured les
and SQL objects.
The OSS pathnames (relative to /G) returned for Guardian les 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 eld 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.
570 Hewlett-Packard Company 527187-007