Fix Bug#30533

* lisp/net/ange-ftp.el (ange-ftp-file-regular-p)
(ange-ftp-real-file-regular-p): New defuns.  (Bug#30533)
This commit is contained in:
Michael Albinus 2018-02-22 11:49:07 +01:00
parent 041c8c4c5d
commit 130c1b8e0e

View file

@ -3373,6 +3373,13 @@ system TYPE.")
(file-error nil))
(ange-ftp-real-file-symlink-p file)))
(defun ange-ftp-file-regular-p (file)
;; Reuse Tramp's implementation.
(if (ange-ftp-ftp-name file)
(and (file-exists-p file)
(eq ?- (aref (file-attribute-modes (file-attributes file)) 0)))
(ange-ftp-real-file-regular-p file)))
(defun ange-ftp-file-exists-p (name)
(setq name (expand-file-name name))
(if (ange-ftp-ftp-name name)
@ -4395,6 +4402,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.")
(put 'file-readable-p 'ange-ftp 'ange-ftp-file-readable-p)
(put 'file-executable-p 'ange-ftp 'ange-ftp-file-executable-p)
(put 'file-symlink-p 'ange-ftp 'ange-ftp-file-symlink-p)
(put 'file-regular-p 'ange-ftp 'ange-ftp-file-regular-p)
(put 'delete-file 'ange-ftp 'ange-ftp-delete-file)
(put 'verify-visited-file-modtime 'ange-ftp
'ange-ftp-verify-visited-file-modtime)
@ -4485,6 +4493,8 @@ NEWNAME should be the name to give the new compressed or uncompressed file.")
(ange-ftp-run-real-handler 'file-executable-p args))
(defun ange-ftp-real-file-symlink-p (&rest args)
(ange-ftp-run-real-handler 'file-symlink-p args))
(defun ange-ftp-real-file-regular-p (&rest args)
(ange-ftp-run-real-handler 'file-regular-p args))
(defun ange-ftp-real-delete-file (&rest args)
(ange-ftp-run-real-handler 'delete-file args))
(defun ange-ftp-real-verify-visited-file-modtime (&rest args)