gpfs_ireaddir64() subroutine
Reads the next directory entry.
Library
GPFS Library (libgpfs.a for AIX®, libgpfs.so for Linux®)
Synopsis
#include <gpfs.h>
int gpfs_ireaddir64(gpfs_ifile_t *idir,
const gpfs_direntx64_t **dirent);
Description
The gpfs_ireaddir64() subroutine returns the next directory entry in a file system. For an overview of using gpfs_ireaddir64() in a backup application, see Using APIs to develop backup applications.
- libgpfs.a for AIX
- libgpfs.so for Linux
Parameters
- idir
- A pointer to gpfs_ifile_t from gpfs_iopen64().
- dirent
- A pointer to the returned pointer to the directory entry.
Exit status
If the gpfs_ireaddir64() subroutine is successful, it returns a value of 0 and sets the dirent parameter to point to the returned directory entry. If there are no more GPFS directory entries, gpfs_ireaddir64() returns a value of 0 and sets the dirent parameter to NULL.
If the gpfs_ireaddir64() subroutine is unsuccessful, it returns a value of -1 and sets the global error variable errno to indicate the nature of the error.
Exceptions
None.
Error status
Error codes include but are not limited to the following:
- ENOMEM
- Unable to allocate memory for the request.
- ENOSYS
- The gpfs_ireaddir64() subroutine is not available.
- ENOTDIR
- File is not a directory.
- EPERM
- The caller does not have superuser privileges.
- ESTALE
- The cached file system information was not valid.
- GPFS_E_INVAL_IFILE
- Incorrect ifile parameter.
Examples
See the gpfs_ireaddir() example in /usr/lpp/mmfs/samples/util/tsreaddir.c.
Location
/usr/lpp/mmfs/lib/libgpfs.a for AIX
/usr/lpp/mmfs/lib/libgpfs.so for Linux