dirread - read directory
sys:= load Sys Sys->PATH;
dirread: fn(fd: ref FD, dir: array of Dir): int;
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 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) are not allowed on directories.
Limbo System Modules, open, read, seek, stat, and readdir
Copyright © 1996,Lucent Technologies, Inc. All rights