DIRECTORY UFFileManager, UserExec, IO, Random, Rope; UFFileTester: CEDAR PROGRAM IMPORTS UFFileManager, UserExec, IO, Random = BEGIN numberOfOpenFiles: NAT = 10; numberOfFileNames: NAT = 15; fileName: ARRAY [0..numberOfFileNames) OF Rope.ROPE = [ "/indigo/pressfonts/TimesRoman-mrr.sd", "/indigo/pressfonts/TimesRoman-mir.sd", "/indigo/pressfonts/TimesRoman-bir.sd", "/indigo/pressfonts/TimesRoman-brr.sd", "/indigo/tioga/tfm/TCLogo.TFM", "/indigo/tioga/tfm/TEMPLATE.TFM", "/indigo/tioga/tfm/TESTFONT12.TFM", "/indigo/tioga/tfm/TimesRoman.TFM", "/indigo/tioga/tfm/TimesRoman12.TFM", "/indigo/tioga/tfm/TimesRoman12I.TFM", "/indigo/tioga/tfm/TimesRoman14.TFM", "/indigo/tioga/tfm/TimesRoman18.TFM", "/indigo/tioga/tfm/TimesRomanB.TFM", "/indigo/tioga/tfm/TimesRomanBI.TFM", "/indigo/tioga/tfm/TimesRomanI.TFM" ]; Test1: PROCEDURE [n: INT] = { file: ARRAY [0..numberOfOpenFiles) OF UFFileManager.FontFile; FOR i: INT IN [0..n) DO slot: [0..numberOfOpenFiles) _ Random.Choose[0, numberOfOpenFiles-1]; fileNo: [0..numberOfFileNames) _ Random.Choose[0, numberOfFileNames-1]; UserExec.GetExecHandle[].GetStreams[].out.PutF["Slot %g request for %g\n", IO.int[slot], IO.rope[fileName[fileNo]]]; file[slot] _ UFFileManager.Open[UFFileManager.KeyOf[fileName[fileNo]]]; ENDLOOP; FOR i: INT IN [0..numberOfOpenFiles) DO file[i] _ NIL; ENDLOOP; }; Test2: PROCEDURE [] = { file: UFFileManager.FontFile; file _ UFFileManager.Open[UFFileManager.KeyOf[fileName[1]]]; file _ NIL; }; trueSeed: INT _ Random.Init[]; fontFileWatcher: UFFileManager.FontFileWatcher = { actionMsg: Rope.ROPE _ SELECT action FROM open => "Opened", close => "Closed", openFailed => "Failed to open", ENDCASE => ERROR; UserExec.GetExecHandle[].GetStreams[].out.PutF["%g file %g\n", IO.rope[actionMsg], IO.rope[UFFileManager.NameOf[key]]]; }; UFFileManager.RegisterFontFileWatcher[fontFileWatcher]; END. PUFFileTester.mesa Last Edited by Michael Plass, January 13, 1983 11:31 am ÊÒ˜J™J™7JšÏk œœ˜4šœœ˜Jšœœ˜+Jšœ˜Jšœœ˜Jšœœ˜šœ œœœ˜7J˜'J˜'J˜'J˜'J˜J˜!J˜#J˜#J˜%J˜&J˜%J˜%J˜$J˜%J˜#J˜—šÏnœ œœ˜Jšœœœ˜=šœœœ˜JšœE˜EJšœG˜GJšœKœ œ˜tJšœG˜GJšœ˜—šœœœ˜'Jšœ œ˜Jšœ˜—J˜—šžœ œ˜Jšœ˜Jšœœ5˜