DIRECTORY IO USING [STREAM], Rope USING [ROPE]; FileUtilDefs: DEFINITIONS = BEGIN UpperCase: PROC[ch: CHARACTER] RETURNS[CHARACTER]; FileExists: PROC [fileName: Rope.ROPE] RETURNS [BOOLEAN]; ExtendFileName: PROC [name, extension: Rope.ROPE] RETURNS [extendedName: Rope.ROPE, extended: BOOLEAN]; GetExtendedFileName: PROC [s: IO.STREAM, extensionName: Rope.ROPE, extensionRequired: BOOLEAN _ TRUE] RETURNS[name, switches: Rope.ROPE]; CheckExtendedFileName: PROC [name, switches, extensionName: Rope.ROPE, extensionRequired: BOOLEAN _ TRUE]; IsSwitch: PROC [ch: CHARACTER, switches: Rope.ROPE] RETURNS[BOOLEAN]; END. fFileUtilDefs.Mesa last edited October 11, 1983 11:52 pm By Paul Rovner If name has an extension, and it is not the desired one, result is FALSE. If the extension is the one desired, result is TRUE. If the name has no extension, tack the desired one on and return TRUE. Snarf "words" (terminated by SP, TAB or CR) from s until either one is found which has (or can be extended with) the indicated extension or s is exhausted. '/...' word suffixes are stuck into 'switches' BEWARE: this changes its 'name' and 'switches' parameters. name.length = 0 => none found. Otherwise, name is the (extended) file name. Êš˜Jšœ™Jšœ4™4J˜šÏk ˜ Jšœœœ˜Jšœœœ˜J˜—Jšœ ˜Jšœ˜J˜Jš Ïn œœ œœ œ˜2J˜Jš ž œœœœœ˜9˜JšœB™BJšœB™BJšœ?™?—šžœœœ˜1Jšœœ œ˜5J˜Jšœ?™?Jšœ4™4JšœV™VJšœ:™:Jšœ5™5Jšœ™—šžœœœœ˜(Jšœœ˜Jšœœœ˜"Jšœœ˜$J˜—šžœœ&œ˜FJšœœœ˜$J˜—Jš žœœ œœœœ˜FJ˜Jšœ˜J˜—…—vv