Modula-2 || Compiler & Tools || Library || Search Engine
FROM SystemTypes IMPORT DirSize, OFF;
TYPE DIR; TYPE FileName = ARRAY [0..DirSize-1] OF CHAR; TYPE Direct = RECORD ino: CARDINAL; name: FileName; END;
PROCEDURE OpenDir(VAR dirp: DIR; filename: ARRAY OF CHAR) : BOOLEAN; PROCEDURE ReadDir(dirp: DIR; VAR direct: Direct) : BOOLEAN; PROCEDURE TellDir(dirp: DIR; VAR offset: OFF) : BOOLEAN; PROCEDURE SeekDir(dirp: DIR; offset: OFF) : BOOLEAN; PROCEDURE RewindDir(dirp: DIR) : BOOLEAN; PROCEDURE CloseDir(VAR dirp: DIR);
ReadDir returns the name and the inode number of the file. It returns FALSE upon reaching the end of the directory or detecting an invalid seekdir operation.
TellDir sets offset to the current location associated with the named directory stream.
SeekDir sets the position of the next ReadDir operation on the directory stream.
RewindDir sets the position of the named directory stream to the beginning of the directory.
CloseDir closes the named directory stream.
Modula-2 || Compiler & Tools || Library || Search Engine