Function: file-local-copy
file-local-copy is a byte-compiled function defined in files.el.gz.
Signature
(file-local-copy FILE)
Documentation
Copy the file FILE into a temporary file on this machine.
Returns the name of the local copy, or nil, if FILE is directly accessible.
Other relevant functions are documented in the file group.
Probably introduced at or before Emacs version 21.1.
Shortdoc
;; file
(file-local-copy "/ssh:user@host:/tmp/foo")
e.g. => "/tmp/tramp.8ihLbO"
(file-local-copy "/tmp/foo")
=> nil
Source Code
;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun file-local-copy (file)
"Copy the file FILE into a temporary file on this machine.
Returns the name of the local copy, or nil, if FILE is directly
accessible."
;; This formerly had an optional BUFFER argument that wasn't used by
;; anything.
(let ((handler (find-file-name-handler file 'file-local-copy)))
(if handler
(funcall handler 'file-local-copy file)
nil)))