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

Re: Mounting Server Volumes

> Is there a way to connect to a server from within MCL, i.e., without going to
> the chooser?
Here's a function I use to mount AppleShare servers.  Unlike the alias method
mentioned earlier, this one requires a direct LAN connection.
(defun mount-server (zone server user password volume &optional (volpass ""))
  (unless password
    (setf password ""))
  (unless user
    (setf user ""))
  (rlet ((afp :AFPVolMountInfo
              :length 175
              :media #$AppleShareMediaType
              :flags 1
              :nbpInterval 5
              :nbpCount 10
              :uamType #$kTwoWayEncryptPassword
              :zoneNameOffset     $zoneNameOffset
              :serverNameOffset   $serverNameOffset
              :volNameOffset      $volNameOffset
              :userNameOffset     $userNameOffset
              :userPassWordOffset $userPassWordOffset
              :volPassWordOffset  $volPassWordOffset))
    (%put-string afp zone     $zoneNameOffset)
    (%put-string afp server   $serverNameOffset)
    (%put-string afp volume   $volNameOffset)
    (%put-string afp user     $userNameOffset)
    (%put-string afp password $userPassWordOffset)
    (%put-string afp volpass  $volPassWordOffset)
    (rlet ((pb :ParamBlockRec
               :ioCompletion (%null-ptr)
               :ioBuffer afp))
      (#_PBVolumeMount pb))))