-- MakeFileIDsImpl.mesa
-- Last edited by
-- Kolling on October 28, 1983 4:09 pm

DIRECTORY

AlpineEnvironment
USING[FileID],
File,
FS
USING[Open],
FilePageMgr
USING[GenerateFileID],
IO
USING[card, Close, Handle, PutF],
Rope
USING[ROPE];


MakeFileIDsImpl: PROGRAM
IMPORTS AE: AlpineEnvironment, FS, FilePageMgr, IO
SHARES File =


BEGIN


NFiles: CARDINAL = 50;

PutFileID: PROCEDURE[fileID: AE.FileID] =
BEGIN
uid: SystemInternal.UniversalID ← LOOPHOLE[fileID];
resultsStreamHandle.PutF["*n%5g %5g %5g %10g ",
IO.card[uid.processor.a], IO.card[uid.processor.b],
IO.card[uid.processor.c], IO.card[uid.sequence]];
END;

Main: PROCEDURE =
BEGIN -- set up to call from CoPilot for debugging.
foo: CARDINAL ← 0;
BEGIN
ENABLE ANY => foo ← foo + 1; -- protect us from the tempcedarexec.

fileID: AE.FileID;
resultsStreamHandle ← FS.Open["MakeFileIDs.Results",
overwrite, none];
resultsStreamHandle.PutF["*n%3g", IO.card[NFiles]];
FOR index: CARDINAL IN [0.. NFiles)
DO fileID ← FilePageMgr.GenerateFileID[];
PutFileID[fileID];
ENDLOOP;

resultsStreamHandle.Close[];

END;
END;



-- main line code:


resultsStreamHandle: IO.Handle;

END.