ProfileHack.mesa
Last Edited by: Swinehart, September 11, 1984 2:21:48 pm PDT
DIRECTORY
Commander USING [ Register, CommandProc ],
FS USING [ Delete, EnumerateForInfo, InfoProc ],
Rope USING [ Cat, Fetch, Length, ROPE, Substr ],
UserCredentials USING [ Get ],
UserProfile USING [ ProfileChanged ];
ProfileHack: CEDAR PROGRAM
IMPORTS Commander, FS, Rope, UserCredentials, UserProfile = {
DoProfileHack: Commander.CommandProc = {
profileChanged: BOOLFALSE;
nameOfLoggedProfile: Rope.ROPE;
DeleteLoggedInsProfiles: FS.InfoProc = {
profileChanged ← TRUE;
FS.Delete[fullFName];
continue←TRUE;
};
nameOfLoggedProfile ← UserCredentials.Get[].name;
FOR i: INT IN [0..nameOfLoggedProfile.Length[]) DO
IF nameOfLoggedProfile.Fetch[i]='. THEN {
nameOfLoggedProfile ← nameOfLoggedProfile.Substr[len:i]; EXIT; }
ENDLOOP;
nameOfLoggedProfile ← Rope.Cat["///", nameOfLoggedProfile, ".profile!*"];
FS.EnumerateForInfo[nameOfLoggedProfile, DeleteLoggedInsProfiles];
IF profileChanged THEN UserProfile.ProfileChanged[edit];
};
Commander.Register[
"ProfileHack",
DoProfileHack,
"Delete any user.profile for logged-in user, then reparse the generic user.profile."
];
}.