Modula-2 || Compiler & Tools || Library || Search Engine


Ulm's Modula-2 Library:
Directories


NAME

Directories - reading directories

SYNOPSIS

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);

DESCRIPTION

OpenDir opens a directory with the name filename and associates a directory stream with it.

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.

DIAGNOSTICS

All routines except CloseDir return FALSE in error case.

AUTHOR

Harald Ruess
Edited by: borchert, last change: 1997/02/25, revision: 1.2, converted to HTML: 1997/04/28

Modula-2 || Compiler & Tools || Library || Search Engine