[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible BUG in MacIvory interface to Mac OS



    Date: Wed, 13 Jun 90 16:58 PDT
    From: larry@atc.boeing.com (Larry Baum)

    I have run into a problem with MTB::_openResFile, as follows:

    Suppose filename is the name of a file that is already open from another
    application (under MultiFinder).

    If I evaluate:

    (mtb::_openResFile filename)

    (which ought to report an error) 
				     
Whether or not _OpenResFile reports an error will depend on how the file
was opened by the other application.  If the other application opened
the data fork and not the resource fork, the _OpenResFile will succeed.
If the other application opened the resource fork with _OpenRFPerm and
specified read-only permission, _OpenResFile will succeed.  How did the
other application open the file?

I did verify that calling _OpenResFile on a resource fork opened in
read-write mode by another application does signal the expected error.

Further, the documentation in Inside Macintosh and the Tech Notes is
wrong w.r.t. the effect of opening a resource fork that's already been
opended before.  Here's a comment from some of the MacIvory's support
code which explains what actually happens.  (This comment applies
equally well to OpenResFile.)

  /* If the resfile was already open, OpenRFPerm changes CurResFile, 
     contrary to IM p.I-115, ...
     The only way to tell whether a particular call to OpenRFPerm actually
     opened the file is to check whether TopMapHndl changed.
     ...
     */

So, if you ask to open a resource file that's already open and the
opening suceeds, you will change the current resource file.

				     while in Zmacs strange behaviour
    results:

    The default Font in most windows changes to an unpleasant one (Zmail is
    pretty unreadable) 

The Macintosh frequently flushes fonts from memory.  When this happens
and it needs the font again, it goes looking for it in the resource
chain.  However, given that the above call to _OpenResFile changed the
current resource file, it's quite likely that the resource file with
Genera's fonts are no longer in the resource chain.  When this happens,
the Mac can't find the font and substitutes something it thinks is
similar.
		       
		       and if I choose "Quit" from the file menu, the system
    hangs and I have to reboot the mac.

The Macintosh support library for MacIvory is trying to close its
resource file.  I wouldn't be at all suprised if closing a file that
doesn't appear to be in chain would wedge the Macintosh.

    I am still using Genera 7.4 with Mac System 6.0.4.

    Larry Baum
    Advanced Technology Center              
    Boeing Computer Services     uucp:       uw-beaver!bcsaic!lbaum
    (206) 865-3365               internet:   lbaum@atc.boeing.com