Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!afsg!ron From: ron@afsg.apple.com (Ron Flax) Newsgroups: comp.unix.aux Subject: Re: Desktop info lost after a 'soft' crash Message-ID: <530@afsg.apple.com> Date: 6 Feb 91 15:27:59 GMT References: <1417@ucl-cs.uucp> Organization: Apple Federal Systems Group Lines: 87 In article <1417@ucl-cs.uucp> J.Purchase@cs.ucl.ac.uk (Jan Purchase) writes: > >I often customize the layout of the hierarchy under my home directory by >using the Finder to colour, group and convert-to-small-icons the files >therein. Indeed I often colour code and group files so that I can >immediately grasp how important they are and how they are related. Understood. > >I've noticed two things about how A/UX (the CommandShell at least) handles >this desktop information that concerns me: Actually it's not the CommandShell, it's startmac. >1) Why is it that when I log in under another account that has read >permission on my home directory and I examine that directory with the >Finder, that the layout is as the default (all large icons, black, in some >weird order, with a blank in the top left icon space). Yet when I log in >under my account the layout is once again as I'd set it. I would understand >this behaviour if each user had an individual System Folder (and thus >desktop info), but currently all users share the System Folder in >"/mac/sys/System Folder" (with mode 0777) The fact that _all_ users are sharing the same System Folder *is* your problem here. It's not actually the System Folder but rather it is the desktop database files; "Desktop DB", "Desktop DF", the file system cache; ".fs_cache", and the file system directory IDs file; .fs_dirIDs in the System Folder. These files are used by the A/UX File Manager to keep track of the things you refered to above. (ie., window placement, icon color, placement, size, etc.. and so on..) When a different user logs on, with different access permissions their view of the file systems changes, and hence changes the contents of these files. One solution is to have individual System Folders per user. That way each user can have his or her own view and not corrupt the "global" view. >2) More irksome. Why after a soft crash (CommandShell dies due to a Finder >crash and A/UX logs you out) is all this desktop info revert to the >default!! I'm really cheesed off with having to re-arrange my icons every >time I or some other user soft-crashes the machine (doesn't happend too >often, but often enough). The reason for this is due to the fact that when a crash occurs the desktop files are left in a corrupt state, and the A/UX File Manager simply rebuilds them from scratch. I was upset about this one too... here's what I do as a work around. I have two small scripts which I will list at the end of this posting that I use to save and restore a "known to be good" set of desktop database, cache and dirIDs files. I normally login to the Console Emulator, then I start the Mac environment by hand by typing 'mac32'. After I have made significant changes to my environment (moved icons, colored them, etc..) I exit from the Mac environment, then I execute the script labeled "savedesk", which saves a backup copy of the Desktop DB, Desktop DF, .fs_cache, and .fs_dirIDs files. If I should crash my Mac environment at some later time, I just exit the environment, and execute the "fixdesk" script to restore my saved set. This seems to work rather well and I have been doing it since A/UX 2.0 started shipping with excellent results. -- Ron Flax ron@afsg.apple.com Apple Federal Systems Group # # @(#) savedesk.sh # if [ ! -d /mac/sys/.save ]; then mkdir /mac/sys/.save fi cp "/mac/sys/System Folder/.fs_cache" /mac/sys/.save cp "/mac/sys/System Folder/.fs_dirIDs" /mac/sys/.save cp "/mac/sys/System Folder/Desktop DB" /mac/sys/.save cp "/mac/sys/System Folder/Desktop DF" /mac/sys/.save # # # @(#) fixdesk.sh # cp "/mac/sys/.save/.fs_cache" "/mac/sys/System Folder/" cp "/mac/sys/.save/.fs_dirIDs" "/mac/sys/System Folder/" cp "/mac/sys/.save/Desktop DB" "/mac/sys/System Folder/" cp "/mac/sys/.save/Desktop DF" "/mac/sys/System Folder/" #