IPB
>  Man Pages > Linux > Suse Linux 10.1 > Section 3 > readdir man page

readdir man page

Section 3 - Suse Linux 10.1 Man Pages

Other operating system man pages available here


Advanced Search

Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!


READDIR(3)                 Linux Programmer's Manual                READDIR(3)




NAME

       readdir - read a directory


SYNOPSIS

       #include <sys/types.h>

       #include <dirent.h>

       struct dirent *readdir(DIR *dir);


DESCRIPTION

       The  readdir()  function returns a pointer to a dirent structure repre-
       senting the next directory entry in the directory stream pointed to  by
       dir.   It  returns  NULL  on  reaching  the  end-of-file or if an error
       occurred.

       On Linux, the dirent structure is defined as follows:

          struct dirent {
              ino_t          d_ino;       /* inode number */
              off_t          d_off;       /* offset to the next dirent */
              unsigned short d_reclen;    /* length of this record */
              unsigned char  d_type;      /* type of file */
              char           d_name[256]; /* filename */
          };

       According to POSIX, the dirent structure contains a field char d_name[]
       of  unspecified  size,  with  at most NAME_MAX characters preceding the
       terminating null byte.  POSIX  1003.1-2001  also  documents  the  field
       ino_t  d_ino  as  an  XSI extension.  Use of other fields will harm the
       portability of your programs.

       The data returned by readdir() may be overwritten by  subsequent  calls
       to readdir() for the same directory stream.


RETURN VALUE

       The readdir() function returns a pointer to a dirent structure, or NULL
       if an error occurs or end-of-file is reached.  On error, errno  is  set
       appropriately.


ERRORS

       EBADF  Invalid directory stream descriptor dir.


CONFORMING TO

       SVID 3, 4.3BSD, POSIX 1003.1-2001


SEE ALSO

       read(2),  closedir(3),  dirfd(3), opendir(3), rewinddir(3), scandir(3),
       seekdir(3), telldir(3)



                                  1996-04-22                        READDIR(3)


Man(1) output converted with man2html and wrapped by fishsponge

This page was generated on Tue Feb 13 02:20:29 GMT 2007

Your favourite pages:

No pages logged yet.
Trying to save cookie...

Top 10 most popular pages:

sqlite3 man page (5323 hits)
(openSUSE 10.2)

svn man page (5173 hits)
(FreeBSD 6.2)

adv_cap_autoneg man page (4865 hits)
(Solaris 10 11_06)

CPAN man page (4602 hits)
(Suse Linux 10.1)

ssh man page (4337 hits)
(Suse Linux 10.1)

ssh-socks5-proxy-connect man page (2841 hits)
(Solaris 10 11_06)

netcat man page (2688 hits)
(Suse Linux 10.1)

pprosetup man page (2473 hits)
(Solaris 10 11_06)

startproc man page (2453 hits)
(Suse Linux 10.1)

signal man page (2394 hits)
(Suse Linux 10.1)

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: Pyrenees Food :: SolidWorks 3D CAD :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum