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

Gator Boxes and Lisp?

We have a Gator Box that allows us to use a Sun Workstation as a Mac
Server.  Unfortunately the Lisp function
"Do-files-in-directory" seems to break when run on most (but not all)
directories on the server.  I am not sure if it a Gator Box problem
or Appleshare problem or Lisp problem.  We don't have seem to have
problems transferring files with Finder, but my Lisp code does
generate errors.

The message I get when I run
Do-files-in-directory (or files-in-directory) is:

> Error: Macintosh System File version 6.0.5

) 1983-90, Apple Computer, Inc.
All rights reserved.
> While executing: FILES-IN-DIRECTORY

I've demacrofied the code and this error gets called in
in the line

As best i can figure out (and I am no expert!) there are two calls to
the trap _HGetFileInfo.  If the result to the first call is zero then
a new file is accessed, otherwise it is assumed that one has run out
of files.  If it not zero then one drops to a second call to
HGetFileInfo where a -43 is expected.  The problem I get with the
server is that this second call might return a zero.

I kludged the code (see below) so that a zero result won't cause an
error but that seems to crash our Gator Box when I run it a lot.


Anyone else running Gator Boxes with Lisp?

Any toolbox experts out there that can tell me if the ACL code is
doing the right thing?  Even if it isn't, it should crash the Gator
Box if the Gator Box software was designed correctly.


;;; here is the kludged version to get a list of files from a
;;; Unix server serviced by the Gator Box.  It will crash the
;;; Gator Box sometimes.

(defun list-of-files (dir)
  (LET ((I NIL)(files nil))
    (CCL::WITH-FILE-OR-DIR dir (a b c)
       (LET ((d 0))
         (%STACK-BLOCK ((s 80) (e 256))
           (CCL::%PSTR-POINTER c e)
           (%PUT-PTR s e 18)
           (%PUT-WORD s a 22)
           (%PUT-LONG s b 48)
             (%PUT-WORD s (SETQ d (CCL::%I+ d 1)) 28)
             ;;; first call to getfileinfo
             (IF (CCL::%IZEROP (CCL::%REGISTER-TRAP 41484 264 s))
                 (%PUT-LONG s b 48)
                 (SETQ I
                      (CCL::%MAKE-MAC-PATHNAME (%GET-SIGNED-WORD s 22)
                                                 (%GET-SIGNED-WORD s 22)
                                                 (%GET-LONG s 48))
                                                (%GET-STRING (%GET-PTR s 18))))
                 (push i files)
                 (GO loop))))
;;; The second call to getfileinfo                 
    (SETQ d (CCL::%REGISTER-TRAP 41484 264 s))
;;; below is the part I changed.  
;;; I changed (if (eql d -43) to
;;;           (if (or (zerop d) (eql d -43))
;;; because the second call to getfileinfo sometimes returned a zero
    (IF (or (zerop d) (EQL d -43))