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

[no subject]



   Date: Fri, 22 Feb 91 02:05:50 PST
   From: REM@SUWATSON.stanford.edu
   To: info-macl@cambridge.apple.com
   
   I've had pretty good luck programming the resource manager traps
   directly from MACL 1.2.2, but I'm having trouble with the file manager,
   for example:
   
Most of the file manager traps take a single argument in A0.  The
argument is called a parameter block, and the offsets in the parameter
block that are read and written by each trap are documented in Inside
Macintosh.  Your code should look something like below.  I get a "File
is Busy" error when I try it on my Macintosh, however.  Seems that the
Finder is holding on to it (that's my guess).

(require-traps)

(defconstant $ioNamePtr 18)
(defconstant $ioVRefNum 22)

(defun volname-unmount (volstr)
  (%stack-block ((pb 24))
    (with-pstrs ((volName volStr))
      (%put-ptr pb volName $ioNamePtr)
      (%put-word pb 0 $ioVRefNum)
      (_UnmountVol :a0 pb :d0))))