The named data streams for a file can be listed by calling getdents
() on the named data stream directory inode, as shown in the following example.
fd = open("foo", O_RDWR); /* open file foo */
afd = vxfs_nattr_open(fd, "stream1",
O_RDWR|O_CREAT, 0777); /* create named data stream
write(afd, buf, 1024); /* writes to named stream file */
read(afd, buf, 1024); /* reads from named stream file */
dfd = vxfs_nattr_open(fd, ".", O_RDONLY);
/* opens named stream directory
getdents(dfd, buf, 1024); /* reads directory entries for
/mount_point/file_with_data_stream/./data_stream_file_name