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

MacIvory Problem: Accessing the Floppy-Disk

    Date: Fri, 12 Apr 91 14:52:13 -0200
    From: bruening%gmdzi.uucp@warbucks.ai.sri.com (Inke Bruening)
    I've a problem using the Mac-Toolbox on a MacIvory.
    I want to access the mac-floppy-disk from genera, 
    but don't want to get macintosh-errors like
    'Please insert the disk xyz'.

    I tried this:

    (condition-case ()
	    (open pathname :direction :probe)
		    (mtb:mac-os-error-nsverr nil))

    This returns nil and no Lisp-Error, but 'Please insert 
    the disk xyz'.

    Maybe, I have to use an other function for macintosh-

That's because there's no error.  The Mac OS handles
the matter of requesting the user to insert floppies completely
transparently from the program.  This is why you can have several
different floppies available at the same time; the Mac OS takes
care of keeping track of which one is currently in the drive, and
which one needs to be inserted next.  From the point of view of
the program, the disks are there whenever the program wishes to
access them.

However, if you type Command-. (Command-Period) at the dialog box
that asks you to insert your disk, *THEN* you'll get the error.
Command-Period is the Macintosh equivalent of Control-Abort; in this
context it means "No, I'm not going to give you that disk".

    Then I tried

    (mtb::do-mac-volumes (name refnum volparameter)

    to find out, whether there is a floppy-disk or not. 
    Unfortunately, it also lists the last floppy-disk
    being used, even if I did eject it before.

Ejecting a disk does not make it unavailable to the program.
To make the Mac forget about it, you have to DISMOUNT it.

    Maybe, I can get some useful information from the
    'volparameter' (Its an 64-array of numbers.) ? What
    is the meaning of these numbers? Is it decribed in 
    'Inside Macintosh' ?

Yes, it's described in Inside Macintosh (Volume IV).

You COULD check to see if the disk volume you want is already
in the drive.  However, I don't think you should.  You'll
undoubtedly confuse your user a great deal.  If the user
did not want to have the option of being asked to insert the
disk, he would have dismounted the disk instead of just ejecting
it.  Ejecting the disk means "I still want to be able to use this
disk; ask me to insert it if necessary".