Veritas™ File System 5.0.1 Programmer's Reference Guide

dirp = opendir(".");
readdir_r(dirp, (struct dirent *)&entry, &result);
Note: The usage section of the getcwd(3C) man page states that applications should
exercise care when using the chdir() call in conjunction with getcwd(). The current
working directory is global to all threads within a process. If more than one thread
calls chdir() to change the working directory, a subsequent call to getcwd() could
produce unexpected results.
Querying named data streams
In the following example, a file named_stream_file was created with 20 named
data streams using the API calls.
The named data streams are not displayed by the ls command. When named data
streams are created, they are organized in a hidden directory. For example:
# ls -al named_stream_file
-r-xr-lr-x1 root other 1024 Aug 12 09:49named_stream_file
To query named data streams
Use the getdents() or readdir_r() system call to query the named_stream_file
file for its directory contents, which contains the 20 named stream files:
Attribute Directory contents for
/vxfstest1/named_stream_file
0x1ff root other 1K Thu Aug 12 09:49:17 2004 .
0x565 root other 1K Thu Aug 12 09:49:17 2004 ..
0x177 root other 1K Thu Aug 12 09:49:17 2004 stream0
0x177 root other 1K Thu Aug 12 09:49:17 2004 stream1
0x177 root other 1K Thu Aug 12 09:49:17 2004 stream2
.
.
.
0x177 root other 1K Thu Aug 12 09:49:17 2004 stream17
0x177 root other 1K Thu Aug 12 09:49:17 2004 stream18
0x177 root other 1K Thu Aug 12 09:49:17 2004 stream19
Named data streams
Querying named data streams
68