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


Ulm's Modula-2 Library:
Archive


NAME

Archive - reading archive files

SYNOPSIS

FROM SystemTypes IMPORT TIME, OFF;


CONST NameLength = 14; TYPE AFILE; TYPE FileName = ARRAY[0..NameLength-1] OF CHAR; TYPE AStat = RECORD name: FileName; uid, gid: CARDINAL; date: TIME; size: OFF; mode: BITSET; END;

PROCEDURE ArchiveOpen(VAR a: AFILE; archive: ARRAY OF CHAR; filename: ARRAY OF CHAR) : BOOLEAN; PROCEDURE ArchiveReopen(a: AFILE; filename: ARRAY OF CHAR) : BOOLEAN; PROCEDURE ArchiveClose(a: AFILE); PROCEDURE ArchiveRead(a: AFILE; VAR ch: CHAR) : BOOLEAN; PROCEDURE ArchiveStat(a: AFILE; VAR buf: AStat);

DESCRIPTION

Archive offers a read-only interface to archives generated on System-V and BSD systems. Note that there is currently no support for newer archives with file names beyond 14 characters in length.

ArchiveOpen opens the file filename archived in the archive archive for reading. A identifies the stream in subsequent operations.

ArchiveReopen searches for the file filename in the archive of a.

ArchiveClose closes the opened stream a.

ArchiveRead stores a single character of the stream a into ch and returns FALSE on end of file.

ArchiveStat stores the status information of the archive file referenced by a into the status buffer buf.

DIAGNOSTICS

ArchiveOpen returns FALSE if the archive file cannot be opened for reading, if archive isn't a archive file, or if filename cannot be found in archive. ArchiveReopen returns FALSE if filename cannot be found.

SEE ALSO

ar(1), more about archives
SystemTypes module SystemTypes

BUGS

Newer archives with long file names are not supported yet.
Edited by: borchert, last change: 1997/02/25, revision: 1.3, converted to HTML: 1997/04/28

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