Function: tramp-sudoedit-handle-delete-file

tramp-sudoedit-handle-delete-file is a byte-compiled function defined in tramp-sudoedit.el.gz.

Signature

(tramp-sudoedit-handle-delete-file FILENAME &optional TRASH)

Documentation

Like delete-file for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sudoedit.el.gz
(defun tramp-sudoedit-handle-delete-file (filename &optional trash)
  "Like `delete-file' for Tramp files."
  (with-parsed-tramp-file-name (expand-file-name filename) nil
    (tramp-flush-file-properties v localname)
    (if (and delete-by-moving-to-trash trash)
	(move-file-to-trash filename)
      (unless (tramp-sudoedit-send-command
	       v "rm" "-f" (tramp-compat-file-name-unquote localname))
	;; Propagate the error.
	(with-current-buffer (tramp-get-connection-buffer v)
	  (goto-char (point-min))
	  (tramp-error-with-buffer
	   nil v 'file-error "Couldn't delete %s" filename))))))