[Top] [Prev] [Next] [Bottom]


[Contents] [Index]

dirread - read directory

dirread: fn(fd: ref FD, dir: array of Dir): int;
## returns number of entries read, or 0 for end of 
directory.

Description

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

System Module Overview
open, create - open/create a file for reading or writing
read, write, stream - read, write, or stream file
seek - change file offset
stat, fstat, fwstat, wstat - get and put file status
readdir - read directory and sort files in Chapter 15


[Top] [Prev] [Next] [Bottom]

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