;;; tramp-fish.el --- Tramp access functions for FISH protocol
-;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes
(directory-files-and-attributes . tramp-fish-handle-directory-files-and-attributes)
;; `dired-call-process' performed by default handler
;; `dired-compress-file' performed by default handler
- ;; `dired-uncache' performed by default handler
+ (dired-uncache . tramp-handle-dired-uncache)
(expand-file-name . tramp-fish-handle-expand-file-name)
;; `file-accessible-directory-p' performed by default handler
(file-attributes . tramp-fish-handle-file-attributes)
(file-remote-p . tramp-handle-file-remote-p)
(file-modes . tramp-handle-file-modes)
(file-name-all-completions . tramp-fish-handle-file-name-all-completions)
- ;; `file-name-as-directory' performed by default handler
+ (file-name-as-directory . tramp-handle-file-name-as-directory)
(file-name-completion . tramp-handle-file-name-completion)
(file-name-directory . tramp-handle-file-name-directory)
(file-name-nondirectory . tramp-handle-file-name-nondirectory)
(tramp-fish-do-copy-or-rename-file
'copy filename newname ok-if-already-exists keep-date preserve-uid-gid))
-(defun tramp-fish-handle-delete-directory (directory)
+(defun tramp-fish-handle-delete-directory (directory &optional recursive)
"Like `delete-directory' for Tramp files."
(when (file-exists-p directory)
- (with-parsed-tramp-file-name
+ (if recursive
+ (mapc
+ (lambda (file)
+ (if (file-directory-p file)
+ (tramp-compat-delete-directory file recursive)
+ (delete-file file)))
+ ;; We do not want to delete "." and "..".
+ (directory-files
+ directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
+ (with-parsed-tramp-file-name
(directory-file-name (expand-file-name directory)) nil
(tramp-flush-directory-property v localname)
(tramp-fish-send-command-and-check v (format "#RMD %s" localname)))))
(when (and keep-date (functionp 'set-file-times))
(set-file-times newname (nth 5 (file-attributes filename))))
;; Set the mode.
- (set-file-modes newname (file-modes filename)))
+ (set-file-modes newname (tramp-default-file-modes filename)))
(defun tramp-fish-get-file-entries (vec localname list)
"Read entries returned by FISH server.