[comp.sys.mac.programmer] Doing horrible things to resource files

nick@lfcs.ed.ac.uk (Nick Rothwell) (06/08/89)

In article <7578@hoptoad.uucp>, tim@hoptoad (Tim Maroney) writes:
>Adding resources to someone else's resource file?  Can you say massive
>potential for conflicts?  Can you say forget about network
>compatibility if you write into an application file?  Can you say every
>sense of programming elegance revolts?

Funny this should come up... only yesterday I was playing with
Microsoft (acht...ptui) Excel. I launched it, and GateKeeper reported
that Excel had done a SetResAttr() on CDEF 1 in the System file. Of
all the spaced-out brain-dead....  Why???

		Nick.
--
Nick Rothwell,	Laboratory for Foundations of Computer Science, Edinburgh.
		nick@lfcs.ed.ac.uk    <Atlantic Ocean>!mcvax!ukc!lfcs!nick
~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
               Fais que ton reve soit plus long que la nuit.

ericsc@microsoft.UUCP (Eric Schlegel) (06/13/89)

In article <2285@etive.ed.ac.uk> nick@lfcs.ed.ac.uk (Nick Rothwell) writes:
>Funny this should come up... only yesterday I was playing with
>Microsoft (acht...ptui) Excel. I launched it, and GateKeeper reported
>that Excel had done a SetResAttr() on CDEF 1 in the System file. Of
>all the spaced-out brain-dead....  Why???

After observing the same behavior, I asked someone in the know here
at Microsoft. It turns out that this CDEF used to have its resPurgeable
bit set in old System files. Under low-memory conditions when a DA
which used this CDEF was running along with Excel, the CDEF would be 
purged. The next time the DA tried to use the CDEF it would crash, taking
Excel with it. So the SetResAttr() makes the CDEF unpurgeable so that
everybody's happy.

Note that I'm not advocating this, just reporting what I was told...

A further note: a quick check in my 6.0.3 System reveals that this
CDEF still has its purgeable bit set. So perhaps this problem still
exists, I don't know.

Eric Schlegel
--------------------
Disclaimer: I'm just summer co-op slime. Nobody with any self-respect
at Microsoft would ever claim that my opinions were those of MS.