Unix/Linux Go Back    

Plan 9 - man page for dirread (plan9 section 2)

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

DIRREAD(2)									       DIRREAD(2)

       dirread - read directory

       #include <u.h>
       #include <libc.h>

       int dirread(int fd, Dir *buf, long nbytes)

       The  data returned by a read(2) on a directory is a set of complete directory entries in a
       machine-independent format, exactly equivalent to the result of a stat(2) on each file  or
       subdirectory  in  the  directory.   Dirread  decodes the directory entries into a machine-
       dependent form.	It reads from fd and unpacks the data into Dir	structures  in	buf  (see
       stat(2)	for  the layout of a Dir).  Nbytes is the size of buf; it should be a multiple of
       sizeof(Dir).  Directory entries have length DIRLEN (defined in <libc.h>) in  machine-inde-
       pendent	form.	A  successful  read  of  a directory always returns a multiple of DIRLEN;
       dirread always returns a multiple of sizeof(Dir).

       Dirread returns the number of bytes filled in buf; the number returned may  be  less  than
       the number requested.  The file offset is advanced by the number of bytes actually read.


       intro(2), open(2), read(2)

       Sets errstr.

Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 07:28 PM.