[Top] [Prev] [Next]

dirread

dirread - read directory

Synopsis

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 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.

See Also

Limbo System Modules, open, read, seek, stat, and readdir



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.