dir-mkdir.lisp 852 B

12345678910111213141516171819202122232425262728
  1. (in-package :hurd-translator)
  2. (def-fs-interface :dir-mkdir ((dir port)
  3. (name :string)
  4. (mode mode-t))
  5. (with-lookup protid dir
  6. (let ((node (get-node protid))
  7. (user (get-user protid)))
  8. (cond
  9. ((not (is-dir-p (stat node)))
  10. :not-directory)
  11. (t
  12. (set-spare mode nil)
  13. (set-vtx mode nil)
  14. (set-type mode :dir)
  15. (let ((result (create-directory *translator*
  16. node
  17. user
  18. name
  19. mode)))
  20. (cond
  21. ((typep result 'node) t)
  22. ((eq result t) t)
  23. ((eq result nil) :not-permitted)
  24. (t result))))))))