|
Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!
System Calls getdents(2)
NAME
getdents - read directory entries and put in a file system
independent format
SYNOPSIS
#include <dirent.h>
int getdents(int fildes, struct dirent *buf, size_t nbyte);
DESCRIPTION
The getdents() function attempts to read nbyte bytes from
the directory associated with the file descriptor fildes and
to format them as file system independent directory entries
in the buffer pointed to by buf. Since the file system
independent directory entries are of variable lengths, in
most cases the actual number of bytes returned will be less
than nbyte. The file system independent directory entry is
specified by the dirent structure. See dirent.h(3HEAD).
On devices capable of seeking, getdents() starts at a posi-
tion in the file given by the file pointer associated with
fildes. Upon return from getdents(), the file pointer is
incremented to point to the next directory entry.
RETURN VALUES
Upon successful completion, a non-negative integer is
returned indicating the number of bytes actually read. A
return value of 0 indicates the end of the directory has
been reached. Otherwise, -1 is returned and errno is set to
indicate the error.
ERRORS
The getdents() function will fail if:
EBADF The fildes argument is not a valid file
descriptor open for reading.
EFAULT The buf argument points to an illegal
address.
EINVAL The nbyte argument is not large enough for
one directory entry.
EIO An I/O error occurred while accessing the
file system.
SunOS 5.10 Last change: 17 Jul 2001 1
System Calls getdents(2)
ENOENT The current file pointer for the directory
is not located at a valid entry.
ENOLINK The fildes argument points to a remote
machine and the link to that machine is no
longer active.
ENOTDIR The fildes argument is not a directory.
EOVERFLOW The value of the dirent structure member
d_ino or d_off cannot be represented in an
ino_t or off_t.
USAGE
The getdents() function was developed to implement the
readdir(3C) function and should not be used for other pur-
poses.
The getdents() function has a transitional interface for
64-bit file offsets. See lf64(5).
SEE ALSO
readdir(3C), dirent.h(3HEAD), lf64(5)
SunOS 5.10 Last change: 17 Jul 2001 2
Man(1) output converted with
man2html and wrapped by fishsponge
This page was generated on Wed Sep 12 11:26:59 GMT 2007
|
Your favourite pages:
No pages logged yet... Top 10 most popular pages:
prstat man page (24546 hits) (Solaris 10 11_06)
netcat man page (17695 hits) (Suse Linux 10.1)
ssh-socks5-proxy-connect man page (13532 hits) (Solaris 10 11_06)
signal man page (12551 hits) (Suse Linux 10.1)
startproc man page (11991 hits) (Suse Linux 10.1)
raidctl man page (11357 hits) (Solaris 10 11_06)
adv_cap_autoneg man page (10286 hits) (Solaris 10 11_06)
sqlite3 man page (9729 hits) (openSUSE 10.2)
CPAN man page (8947 hits) (Suse Linux 10.1)
BusyBox man page (7702 hits) (Suse Linux 10.1)
|