anchor.diff:  ;;     (write-sector disk (fat-%fat-info fat) sector 1)))
   
   (defmethod read-fat (disk (fat12 fat12))
  -  (let* ((file-allocation-data (read-sector disk (fat-%n-reserved-sectors fat12) (fat-%sectors-per-fat fat12)))
  -         (fat (make-array (list (floor (/ (ash (length file-allocation-data) 3) 12))))))
  -    (loop :for offset :from 0 :by 3 :below (- (length file-allocation-data) 2)
  -          :for i :from 0 :by 2
  -          :for byte0 := (aref file-allocation-data offset)
  -          :for byte1 := (aref file-allocation-data (1+ offset))
  -          :for byte2 := (aref file-allocation-data (+ 2 offset))
  -          :for cluster0 := (dpb (ldb (byte 4 0) byte1) (byte 4 8) byte0)
  -          :for cluster1 := (dpb (ldb (byte 4 4) byte1) (byte 4 8) byte2)
  -          :do (setf (aref fat i) cluster0
  -                    (aref fat (1+ i)) cluster1))
  -    fat))
  +  (loop :with fat-offset := (fat-%n-reserved-sectors fat12)
  +        :with file-allocation-table := (read-sector disk fat-offset (fat-%sectors-per-fat fat12))
  +        :with fat := (make-array (list (floor (/ (ash (length file-allocation-table) 3) 12))))
  +        :for offset :from 0 :by 3 :below (- (length file-allocation-table) 2)
  +        :for i :from 0 :by 2
  +        :for byte0 := (aref file-allocation-table offset)
  +        :for byte1 := (aref file-allocation-table (1+ offset))
  +        :for byte2 := (aref file-allocation-table (+ 2 offset))
  +        :for cluster0 := (dpb (ldb (byte 4 0) byte1) (byte 4 8) byte0)
  +        :for cluster1 := (dpb (ldb (byte 4 4) byte1) (byte 4 8) byte2)
  +        :do (setf (aref fat i) cluster0
  +                  (aref fat (1+ i)) cluster1)
  +        :finally (return fat)))
   
   (defmethod write-fat (disk (fat12 fat12) fat)
  -  (let* ((file-allocation-data (read-sector disk (fat-%n-reserved-sectors fat12) (fat-%sectors-per-fat fat12))))
  -    (loop :for offset :from 0 :by 3 :below (- (length file-allocation-data) 2)
  -          :for i :from 0 :by 2
  -          :for cluster0 := (aref fat i)
  -          :for cluster1 := (aref fat (1+ i))
  -          :for byte0 := (ldb (byte 8 0) cluster0)
  -          :for byte1 := (dpb (ldb (byte 4 8) cluster1)
  -                             (byte 4 4)
  -                             (ldb (byte 4 8) cluster0))
  -          :for byte2 := (ldb (byte 8 0) cluster1)
  -          :do (setf (aref file-allocation-data offset) byte0
  -                    (aref file-allocation-data (1+ offset)) byte1
  -                    (aref file-allocation-data (+ 2 offset)) byte2))
  -    (write-sector disk (fat-%n-reserved-sectors fat12) file-allocation-data (fat-%sectors-per-fat fat12))))
  +  (loop :with fat-offset := (fat-%n-reserved-sectors fat12)
  +        :with file-allocation-table := (read-sector disk fat-offset (fat-%sectors-per-fat fat12))
  +        :for offset :from 0 :by 3 :below (- (length file-allocation-table) 2)
  +        :for i :from 0 :by 2
  +        :for cluster0 := (aref fat i)
  +        :for cluster1 := (aref fat (1+ i))
  +        :for byte0 := (ldb (byte 8 0) cluster0)
  +        :for byte1 := (dpb (ldb (byte 4 8) cluster1)
  +                           (byte 4 4)
  +                           (ldb (byte 4 8) cluster0))
  +        :for byte2 := (ldb (byte 8 0) cluster1)
  +        :do (setf (aref file-allocation-table offset) byte0
  +                  (aref file-allocation-table (1+ offset)) byte1
  +                  (aref file-allocation-table (+ 2 offset)) byte2)
  +        :finally (write-sector disk fat-offset file-allocation-table (fat-%sectors-per-fat fat12))))
   
   (defmethod read-fat (disk (fat16 fat16))
  -  (let* ((file-allocation-data (read-sector disk (fat-%n-reserved-sectors fat16) (fat-%sectors-per-fat fat16)))
  -         (fat (make-array (list (ash (length file-allocation-data) -1)))))
  -    (loop :for offset :from 0 :by 2 :below (length file-allocation-data)
  -          :for i :from 0
  -          :for cluster-n := (sys.int::ub16ref/le file-allocation-data offset)
  -          :do (setf (aref fat i) cluster-n))
  -    fat))
  +  (loop :with fat-offset := (fat-%n-reserved-sectors fat16)
  +        :with file-allocation-table := (read-sector disk fat-offset (fat-%sectors-per-fat fat16))
  +        :with fat := (make-array (list (ash (length file-allocation-table) -1)))
  +        :for offset :from 0 :by 2 :below (length file-allocation-table)
  +        :for i :from 0
  +        :for cluster-n := (sys.int::ub16ref/le file-allocation-table offset)
  +        :do (setf (aref fat i) cluster-n)
  +        :finally (return fat)))
   
   (defmethod write-fat (disk (fat16 fat16) fat)
  -  (let* ((file-allocation-data (read-sector disk (fat-%n-reserved-sectors fat16) (fat-%sectors-per-fat fat16))))
  -    (loop :for offset :from 0 :by 2 :below (length file-allocation-data)
  -          :for i :from 0
  -          :for cluster-n := (aref fat i)
  -          :do (setf (sys.int::ub16ref/le file-allocation-data offset) cluster-n))
  -    (write-sector disk (fat-%n-reserved-sectors fat16) file-allocation-data (fat-%sectors-per-fat fat16))))
  +  (loop :with fat-offset := (fat-%n-reserved-sectors fat16)
  +        :with file-allocation-table := (read-sector disk fat-offset (fat-%sectors-per-fat fat16))
  +        :for offset :from 0 :by 2 :below (length file-allocation-table)
  +        :for i :from 0
  +        :for cluster-n := (aref fat i)
  +        :do (setf (sys.int::ub16ref/le file-allocation-table offset) cluster-n)
  +        :finally (write-sector disk fat-offset file-allocation-table (fat-%sectors-per-fat fat16))))
   
   (defmethod read-fat (disk (fat32 fat32))
  -  (let* ((file-allocation-data (read-sector disk
  -                                            (fat-%n-reserved-sectors fat32)
  -                                            (/ (fat32-%sectors-per-fat fat32)
  -                                               (fat-%n-fats fat32))))
  -         (fat (make-array (list (ash (length file-allocation-data) -2)))))
  -    (loop :for offset :from 0 :by 4 :below (length file-allocation-data)
  -          :for i :from 0
  -          :for cluster-n := (sys.int::ub32ref/le file-allocation-data offset)
  -          :do (setf (aref fat i) cluster-n))
  -    fat))
  +  (loop :with fat-offset := (fat-%n-reserved-sectors fat32)
  +        :with file-allocation-table := (read-sector disk fat-offset (/ (fat32-%sectors-per-fat fat32)
  +                                                                       (fat-%n-fats fat32)))
  +        :with fat := (make-array (list (ash (length file-allocation-table) -2)))
  +        :for offset :from 0 :by 4 :below (length file-allocation-table)
  +        :for i :from 0
  +        :for cluster-n := (sys.int::ub32ref/le file-allocation-table offset)
  +        :do (setf (aref fat i) cluster-n)
  +        :finally (return fat)))
   
   (defmethod write-fat (disk (fat32 fat32) fat)
  -  (let* ((file-allocation-data (read-sector disk
  -                                            (fat-%n-reserved-sectors fat32)
  -                                            (/ (fat32-%sectors-per-fat fat32)
  -                                               (fat-%n-fats fat32)))))
  -    (loop :for offset :from 0 :by 4 :below (length file-allocation-data)
  -          :for i :from 0
  -          :for cluster-n := (aref fat i)
  -          :do (setf (sys.int::ub32ref/le file-allocation-data offset) cluster-n))
  -    (write-sector disk
  -                  (fat-%n-reserved-sectors fat32)
  -                  file-allocation-data
  -                  (/ (fat32-%sectors-per-fat fat32)
  -                     (fat-%n-fats fat32)))))
  +  (loop :with fat-offset := (fat-%n-reserved-sectors fat32)
  +        :with file-allocation-table := (read-sector disk fat-offset (/ (fat32-%sectors-per-fat fat32)
  +                                                                       (fat-%n-fats fat32)))
  +        :for offset :from 0 :by 4 :below (length file-allocation-table)
  +        :for i :from 0
  +        :for cluster-n := (aref fat i)
  +        :do (setf (sys.int::ub32ref/le file-allocation-table offset) cluster-n)
  +        :finally (write-sector disk fat-offset file-allocation-table (/ (fat32-%sectors-per-fat fat32)
  +                                                                        (fat-%n-fats fat32)))))
   
   (defmethod root-dir-sectors ((fat12 fat12))
     (floor (/ (+ (ash (fat-%n-root-entry fat12) 5)
  
positive.code:                                                                 (pathname-name pathname)
                                                                  (pathname-type pathname)
                                                                  (ash 1 +attribute-archive+))
                                     created-file t
                                     abort-action :delete)
                               (error 'simple-file-error
                                      :pathname pathname
                                      :format-control "File ~A does not exist. ~S"
                                      :format-arguments (list pathname (file-name pathname)))))))))
        (when (and (not created-file) (member direction '(:output :io)))
          (ecase if-exists
            (:error (error 'simple-file-error
                           :pathname pathname
  
negative.code:              (error 'simple-file-error
                      :pathname pathname
                      :format-control "Could not supersede ~S."
                      :format-arguments (list pathname))))
            ;; TODO :supersede
            (:supersede
             (error ":supersede is not implemented")
  