comparison lisp/net/tramp-fish.el @ 108816:94d1d8a6dcfd

* net/tramp-compat.el (tramp-compat-delete-file): Use `symbol-value' for backward compatibility. * net/tramp.el (tramp-handle-make-symbolic-link) (tramp-handle-load) (tramp-do-copy-or-rename-file-via-buffer) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (tramp-handle-process-file, tramp-handle-call-process-region) (tramp-handle-shell-command, tramp-handle-file-local-copy) (tramp-handle-insert-file-contents, tramp-handle-write-region) (tramp-delete-temp-file-function): Use `delete-file' instead of `tramp-compat-delete-file'. * net/tramp-fish.el (tramp-fish-handle-delete-directory) (tramp-fish-handle-make-symbolic-link) (tramp-fish-handle-process-file): Use `delete-file' instead of `tramp-compat-delete-file'. * net/tramp-ftp.el (tramp-ftp-file-name-handler): Use `delete-file' instead of `tramp-compat-delete-file'. * net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): Rename arg. (tramp-gvfs-handle-write-region): Use `delete-file' instead of `tramp-compat-delete-file'. * net/tramp-imap.el (tramp-imap-do-copy-or-rename-file): Use `delete-file' instead of `tramp-compat-delete-file'. * net/tramp-smb.el (tramp-smb-handle-copy-file) (tramp-smb-handle-file-local-copy, tramp-smb-handle-rename-file) (tramp-smb-handle-write-region): Use `delete-file' instead of `tramp-compat-delete-file'. (tramp-smb-handle-delete-directory): Use 'trash as arg.
author Michael Albinus <michael.albinus@gmx.de>
date Fri, 28 May 2010 15:28:36 +0200
parents 511da81b16c5
children 280c8ae2476d
comparison
equal deleted inserted replaced
108815:93729e1f822d 108816:94d1d8a6dcfd
324 (if recursive 324 (if recursive
325 (mapc 325 (mapc
326 (lambda (file) 326 (lambda (file)
327 (if (file-directory-p file) 327 (if (file-directory-p file)
328 (tramp-compat-delete-directory file recursive) 328 (tramp-compat-delete-directory file recursive)
329 (tramp-compat-delete-file file))) 329 (delete-file file)))
330 ;; We do not want to delete "." and "..". 330 ;; We do not want to delete "." and "..".
331 (directory-files 331 (directory-files
332 directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))) 332 directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
333 (with-parsed-tramp-file-name 333 (with-parsed-tramp-file-name
334 (directory-file-name (expand-file-name directory)) nil 334 (directory-file-name (expand-file-name directory)) nil
335 (tramp-flush-directory-property v localname) 335 (tramp-flush-directory-property v localname)
336 (tramp-fish-send-command-and-check v (format "#RMD %s" localname))))) 336 (tramp-fish-send-command-and-check v (format "#RMD %s" localname)))))
337 337
338 (defun tramp-fish-handle-delete-file (filename &optional trash) 338 (defun tramp-fish-handle-delete-file (filename &optional trash)
339 "Like `delete-file' for Tramp files." 339 "Like `delete-file' for Tramp files."
340 (when (file-exists-p filename) 340 (when (file-exists-p filename)
341 (with-parsed-tramp-file-name (expand-file-name filename) nil 341 (with-parsed-tramp-file-name (expand-file-name filename) nil
658 (format 658 (format
659 "File %s already exists; make it a link anyway? " 659 "File %s already exists; make it a link anyway? "
660 localname))))) 660 localname)))))
661 (tramp-error 661 (tramp-error
662 v 'file-already-exists "File %s already exists" localname) 662 v 'file-already-exists "File %s already exists" localname)
663 (tramp-compat-delete-file linkname))) 663 (delete-file linkname)))
664 664
665 ;; If FILENAME is a Tramp name, use just the localname component. 665 ;; If FILENAME is a Tramp name, use just the localname component.
666 (when (tramp-tramp-file-p filename) 666 (when (tramp-tramp-file-p filename)
667 (setq filename (tramp-file-name-localname 667 (setq filename (tramp-file-name-localname
668 (tramp-dissect-file-name (expand-file-name filename))))) 668 (tramp-dissect-file-name (expand-file-name filename)))))
837 (error (setq ret 1))) 837 (error (setq ret 1)))
838 838
839 ;; Provide error file. 839 ;; Provide error file.
840 (when tmpstderr (rename-file tmpstderr (cadr destination) t)) 840 (when tmpstderr (rename-file tmpstderr (cadr destination) t))
841 ;; Cleanup. 841 ;; Cleanup.
842 (when tmpinput (tramp-compat-delete-file tmpinput)) 842 (when tmpinput (delete-file tmpinput))
843 (when tmpoutput (tramp-compat-delete-file tmpoutput)) 843 (when tmpoutput (delete-file tmpoutput))
844 ;; Return exit status. 844 ;; Return exit status.
845 ret))) 845 ret)))
846 846
847 847
848 ;; Internal file name functions 848 ;; Internal file name functions