sys-dirread man page on Inferno

Man page or keyword search:  
man Server   579 pages
apropos Keyword Search (all sections)
Output format
Inferno logo
[printable version]

SYS-DIRREAD(2)							SYS-DIRREAD(2)

NAME
       dirread - read directory

SYNOPSIS
       include "sys.m";
       sys := load Sys Sys->PATH;

       dirread:	 fn(fd: ref FD): (int, array of Dir);

DESCRIPTION
       Dirread reads the contents of the directory pointed to by the open file
       descriptor fd, returning a tuple	 containing  an	 array	with  one  Dir
       structure  for  each  directory	entry  read.  These Dir structures are
       equivalent to the result of a stat call on each file in the  directory.
       See sys-stat(2) for a description of stat and Dir.

       A  successful dirread returns a tuple giving the number of entries read
       and the resulting array.	 A return of (0,nil) indicates the end of  the
       directory.   Directory entries are variable length in general; the file
       offset is advanced by the number of bytes actually read.

       Seeks (see sys-seek(2)) are allowed on directories only to seek to  the
       start.

       In  general,  several calls to dirread will be needed to read the whole
       directory.  Readdir (2) provides functions that return all  the	direcā€
       tory entries at once, optionally sorted.

SEE ALSO
       readdir(2),  sys-intro(2),  sys-open(2), sys-read(2), sys-seek(2), sys-
       stat(2)

DIAGNOSTICS
       The integer in dirread's return tuple has a value of -1 on error, and 0
       on end of file.	The array element of the tuple is nil in both cases.

								SYS-DIRREAD(2)
[top]

List of man pages available for Inferno

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net