comparison lisp/net/tramp-fish.el @ 105352:f92b20f3ef80

* net/tramp-fish.el (tramp-fish-handle-delete-directory): Handle optional parameter RECURSIVE.
author Michael Albinus <michael.albinus@gmx.de>
date Thu, 01 Oct 2009 15:35:35 +0000
parents bd92ac143136
children ae9f17f9fa46
comparison
equal deleted inserted replaced
105351:4eaec3ddca1c 105352:f92b20f3ef80
310 (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid) 310 (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid)
311 "Like `copy-file' for Tramp files." 311 "Like `copy-file' for Tramp files."
312 (tramp-fish-do-copy-or-rename-file 312 (tramp-fish-do-copy-or-rename-file
313 'copy filename newname ok-if-already-exists keep-date preserve-uid-gid)) 313 'copy filename newname ok-if-already-exists keep-date preserve-uid-gid))
314 314
315 (defun tramp-fish-handle-delete-directory (directory) 315 (defun tramp-fish-handle-delete-directory (directory &optional recursive)
316 "Like `delete-directory' for Tramp files." 316 "Like `delete-directory' for Tramp files."
317 (when (file-exists-p directory) 317 (when (file-exists-p directory)
318 (with-parsed-tramp-file-name 318 (if recursive
319 (mapc
320 (lambda (file)
321 (if (file-directory-p file)
322 (delete-directory file recursive)
323 (delete-file file)))
324 ;; We do not want to delete "." and "..".
325 (directory-files
326 directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
327 (with-parsed-tramp-file-name
319 (directory-file-name (expand-file-name directory)) nil 328 (directory-file-name (expand-file-name directory)) nil
320 (tramp-flush-directory-property v localname) 329 (tramp-flush-directory-property v localname)
321 (tramp-fish-send-command-and-check v (format "#RMD %s" localname))))) 330 (tramp-fish-send-command-and-check v (format "#RMD %s" localname)))))
322 331
323 (defun tramp-fish-handle-delete-file (filename) 332 (defun tramp-fish-handle-delete-file (filename)