Copyright (C) 1984, Xerox Corporation. All rights reserved. Package: UPOps Maintainer: Lamming Date: October 29, 1984 4:22:05 pm PST DF file: UPOps.df Purpose: Generate list of filenames from template and user.profile Description: This interface is designed to allow clients to generate a list of filenames from a template. Its main purpose is to overcome the difficulty of generating filenames to meet local naming conventions. This is to compensate for our inability to agree on a standard! For example, a problem occurs with AIS separation files. Normally AIS filenames conform to the template -., e.g. foo-grn.ais. Even so at least two different SeparationFlag naming conventions exist and at least two AISExtension naming conventions. For example, one client will use the flag "grn" to name the green separation, another "g" and a third "green". When these options are permuted with the AISExtension naming conventions ".pic", ".ais", ".image", 9 file names are possible. The procedure Expand provides a simple way of specifying a template containing keys that are to be replaced by ropes extracted from the user.profile. The format rope conforms to the protocol used by the formatting routine PutF in IO. (See IODoc.tioga). In its simplest form Expand can be used like PutFR to generate a single rope from the format rope and the IO.Values: v1..v5. Note that Expand actually returns a list of length 1. e.g. Expand["File%g.ext", IO.real[99]] => "File99.ext" To use the user.profile substitution feature a special format sequence introduced by %k is used. The general form of this format sequence is: %k where: is any character used to delimit the following sequences of characters is a user.profile key as specified by UserProfileDoc.Tioga is a default sequence to be used if no corresponding key is found So the example described earlier would be handled as follows: list _ Expand["%g%k|AISseparationKeys.green|red|.%k|AISExtensions|ais|", IO.rope[fileStem]]; The user profile would be searched for the keys: "AISseparationKeys.green" and "AISExtensions" and every possible permutation of ropes returned. If the user profile contained the entries: AISseparationKeys.green: "-grn" "-green" "-g" AISExtensions: "ais" "pic" "image" and fileStem = "Foo", then list _ ("Foo-grn.ais", "Foo-grn.pic", "Foo-grn.image", "Foo-green.ais", "Foo-green.pic", "Foo-green.image", "Foo-g.ais", "Foo-g.pic", "Foo-g.image") Note that the first name in the list is built from the first options of each user.profile key. This is handy for creating new files in the locally preferred format. If neither key had been present in the user.profile then list _ ("Foo-grn.ais") Κ5˜Inote˜