include "sys.m";
sys:= load Sys Sys->PATH;
dirread: fn(fd: ref FD, dir: array of Dir): int;
Description
dirread (fd, dir)
The dirread function reads the contents of the directory pointed to by the open file descriptor fd, filling in the array dir with one Dir structure for each element. These Dir structures are equivalent to the result of a stat call on each file in the directory. See stat, fstat, fwstat, wstat - get and put file status for a description of stat and Dir.
A successful dirread returns the number of entries read up to the length of array dir. The number returned may be less than the number requested. The file offset is advanced by the number of bytes actually read. A return of 0 indicates the end of the directory.
Seeks (see seek - change file offset) are not allowed on directories.
See Also
infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights
reserved.