- (cond
- ((= ?w (aref modes 8))
- (insert "exit 0"))
- ((= ?w (aref modes 5))
- (insert "chgrp " (number-to-string (nth 3 attr))
- " $* && chmod g+s $*\n"))
- ((= ?w (aref modes 2))
- (insert "chown " (number-to-string (nth 2 attr))
- " $* && chmod u+s $*\n"))
- (t
- (insert "chown root $* && chmod u+s $*\n"))))
+ (setq attr (file-attributes dirname))
+ (if (not (eq t (car attr)))
+ (insert (format "echo %s is not a directory\n" rmail-spool-directory))
+ (setq modes (nth 8 attr))
+ (cond ((= ?w (aref modes 8))
+ ;; Nothing needs to be done.
+ )
+ ((= ?w (aref modes 5))
+ (insert "chgrp " (number-to-string (nth 3 attr))
+ " $* && chmod g+s $*\n"))
+ ((= ?w (aref modes 2))
+ (insert "chown " (number-to-string (nth 2 attr))
+ " $* && chmod u+s $*\n"))
+ (t
+ (insert "chown root $* && chmod u+s $*\n"))))
+ (insert "echo mail directory = " dirname "\n"))