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: BOOL←FALSE;
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];
};