1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-17 08:43:21 +00:00
PDP-10.its/src/libdoc/filbit.1

31 lines
809 B
Common Lisp
Executable File

;; -*-Mode:LISP; Author:RWK-*-
(herald FILBIT /1)
(or (get 'UMLMAC 'VERSION)
(load '((LISP) UMLMAC FASL)))
;; Return the modes a file was opened in (whether file is open or not).
(defun filemodes (file)
(let ((modes (arraycall fixnum file 8.))
(outlist))
(if (zerop (logand modes (lsh #o400000 18.)))
(push 'BLOCK outlist)
(push 'SINGLE outlist))
(if (not (zerop (logand modes (lsh #o20000 18.))))
(push 'APPEND outlist))
(if (not (zerop (logand modes (lsh #o40 18.))))
(push 'CLA outlist))
(if (zerop (logand modes #o2))
(push 'DSK outlist)
(push 'TTY outlist))
(if (zerop (logand modes #o1))
(push 'IN outlist)
(push 'OUT outlist))
(caseq (ldb #o0202 modes)
(0 (push 'ASCII outlist))
(1 (push 'FIXNUM outlist))
(2 (push 'IMAGE outlist)))
outlist))