mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 21:32:26 +00:00
34 lines
457 B
Modula-2
34 lines
457 B
Modula-2
MODULE testFiles;
|
|
|
|
IMPORT Files, Texts := CmdlnTexts, Console;
|
|
|
|
CONST file="makefile";
|
|
|
|
VAR
|
|
T : Texts.Text;
|
|
R : Texts.Reader;
|
|
F : Files.File;
|
|
ch : CHAR;
|
|
BEGIN
|
|
|
|
F := Files.Old (file);
|
|
IF F # NIL THEN
|
|
NEW(T);
|
|
Texts.Open(T, file);
|
|
Texts.OpenReader(R, T, 0);
|
|
Texts.Read (R, ch);
|
|
|
|
WHILE ~R.eot DO
|
|
Texts.Read (R, ch);
|
|
Console.Char(ch);
|
|
|
|
END;
|
|
|
|
ELSE
|
|
|
|
Console.String ("cannot open"); Console.Ln;
|
|
|
|
END;
|
|
|
|
|
|
END testFiles.
|