• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/eshell/

Lines Matching +refs:file +refs:modes

8 ;; This file is part of GNU Emacs.
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
48 (defcustom eshell-group-file "/etc/group"
49 "*If non-nil, the name of the group file on your system."
50 :type '(choice (const :tag "No group file" nil) file)
53 (defcustom eshell-passwd-file "/etc/passwd"
54 "*If non-nil, the name of the passwd file on your system."
55 :type '(choice (const :tag "No passwd file" nil) file)
58 (defcustom eshell-hosts-file "/etc/hosts"
59 "*The name of the /etc/hosts file."
60 :type '(choice (const :tag "No hosts file" nil) file)
69 (defcustom eshell-private-file-modes 384 ; umask 177
70 "*The file-modes value to use for creating \"private\" files."
74 (defcustom eshell-private-directory-modes 448 ; umask 077
75 "*The file-modes value to use for creating \"private\" directories."
81 "*Regular expression used to match tar file names."
91 specification of filenames (for example, in calling `find-file', or
93 following in your .emacs file:
95 (put 'find-file 'eshell-no-numeric-conversions t)
126 "A timestamp of when the group file was read.")
132 "A timestamp of when the user file was read.")
138 "A timestamp of when the hosts file was read.")
161 (if (and (fboundp 'cl-compiling-file) (cl-compiling-file))
438 (defun eshell-read-passwd-file (file)
441 (when (file-readable-p file)
443 (insert-file-contents file)
458 (defun eshell-read-passwd (file result-var timestamp-var)
464 (nth 5 (file-attributes file))))
466 (set result-var (eshell-read-passwd-file file))
472 (if eshell-group-file
473 (eshell-read-passwd eshell-group-file 'eshell-group-names
486 (if eshell-passwd-file
487 (eshell-read-passwd eshell-passwd-file 'eshell-user-names
496 (defun eshell-read-hosts-file (filename)
497 "Read in the hosts from the /etc/hosts file."
500 (insert-file-contents eshell-hosts-file)
512 (defun eshell-read-hosts (file result-var timestamp-var)
518 (nth 5 (file-attributes file))))
520 (set result-var (eshell-read-hosts-file file))
526 (if eshell-hosts-file
527 (eshell-read-hosts eshell-hosts-file 'eshell-host-names
564 (defmacro eshell-with-file-modes (modes &rest forms)
565 "Evaluate, with file-modes set to MODES, the given FORMS."
566 `(let ((modes (default-file-modes)))
567 (set-default-file-modes ,modes)
570 (set-default-file-modes modes))))
572 (defmacro eshell-with-private-file-modes (&rest forms)
573 "Evaluate FORMS with private file modes set."
574 `(eshell-with-file-modes ,eshell-private-file-modes ,@forms))
577 "Make DIR with file-modes set to `eshell-private-directory-modes'."
578 (eshell-with-file-modes eshell-private-directory-modes
592 If FULL is non-nil, return absolute file names. Otherwise return names
594 If MATCH is non-nil, mention only file names that match the regexp MATCH.
597 (let ((directory (expand-file-name directory)) ange-cache)
600 (lambda (file)
601 (cons file (eshell-file-attributes (expand-file-name file directory)))))
608 "Make sure to use the handler for `directory-file-and-attributes'."
609 (let* ((dir (expand-file-name dir))
610 (dfh (find-file-name-handler dir 'directory-files)))
614 (fah (find-file-name-handler dir 'file-attributes)))
617 (lambda (file)
618 (cons file (if fah
619 (eshell-file-attributes
620 (expand-file-name file dir))
621 (file-attributes (expand-file-name file dir))))))
672 (ange-ftp-file-modtime (expand-file-name name dir))))
690 (defun eshell-file-attributes (file)
692 (let* ((file (expand-file-name file))
693 (handler (find-file-name-handler file 'file-attributes))
696 (file-attributes file)
697 (if (eq (find-file-name-handler (file-name-directory file)
700 (let ((base (file-name-nondirectory file))
701 (dir (file-name-directory file)))
715 (or entry (funcall handler 'file-attributes file)))))
723 ; (defun eshell-copy-file
724 ; (file newname &optional ok-if-already-exists keep-date)
725 ; "Copy FILE to NEWNAME. See docs for `copy-file'."
727 ; (if (string-match "\\`\\([^:]+\\):\\(.*\\)" file)
728 ; (let ((front (match-string 1 file))
729 ; (back (match-string 2 file))
732 ; (setq buffer (find-file-noselect front)))
738 ; (tar-copy (if (file-directory-p newname)
739 ; (expand-file-name
740 ; (file-name-nondirectory back) newname)
743 ; (error "%s not found in tar file %s" back front))))))
745 ; (copy-file file newname ok-if-already-exists keep-date))))
747 ; (defun eshell-file-attributes (filename)
748 ; "Return a list of attributes of file FILENAME.
749 ; See the documentation for `file-attributes'."
756 ; (setq buffer (find-file-noselect front)))
782 ; (tar-grind-file-mode (tar-header-mode tokens)
786 ; (file-attributes filename))))