comparison lisp/net/ange-ftp.el @ 102850:0bb3e7671842

* net/ange-ftp.el (ange-ftp-set-file-modes): New defun. Change `ange-ftp' property of `set-file-modes' to `ange-ftp-set-file-modes'. (ange-ftp-call-chmod): Add error handling.
author Michael Albinus <michael.albinus@gmx.de>
date Sun, 05 Apr 2009 17:49:47 +0000
parents 55824e6d083c
children 10c38084881d
comparison
equal deleted inserted replaced
102849:ec97c15e7e13 102850:0bb3e7671842
4348 (put 'file-name-sans-versions 'ange-ftp 'ange-ftp-file-name-sans-versions) 4348 (put 'file-name-sans-versions 'ange-ftp 'ange-ftp-file-name-sans-versions)
4349 (put 'dired-uncache 'ange-ftp 'ange-ftp-dired-uncache) 4349 (put 'dired-uncache 'ange-ftp 'ange-ftp-dired-uncache)
4350 (put 'dired-compress-file 'ange-ftp 'ange-ftp-dired-compress-file) 4350 (put 'dired-compress-file 'ange-ftp 'ange-ftp-dired-compress-file)
4351 (put 'load 'ange-ftp 'ange-ftp-load) 4351 (put 'load 'ange-ftp 'ange-ftp-load)
4352 (put 'find-backup-file-name 'ange-ftp 'ange-ftp-find-backup-file-name) 4352 (put 'find-backup-file-name 'ange-ftp 'ange-ftp-find-backup-file-name)
4353 (put 'set-file-modes 'ange-ftp 'ange-ftp-set-file-modes)
4353 4354
4354 ;; Turn off truename processing to save time. 4355 ;; Turn off truename processing to save time.
4355 ;; Treat each name as its own truename. 4356 ;; Treat each name as its own truename.
4356 (put 'file-truename 'ange-ftp 'identity) 4357 (put 'file-truename 'ange-ftp 'identity)
4357 4358
4358 ;; We must return non-nil in order to mask our inability to do the job. 4359 ;; We must return non-nil in order to mask our inability to do the job.
4359 ;; Otherwise there are errors when applied to the target file during 4360 ;; Otherwise there are errors when applied to the target file during
4360 ;; copying from a (localhost) Tramp file. 4361 ;; copying from a (localhost) Tramp file.
4361 (put 'set-file-modes 'ange-ftp 'ignore)
4362 (put 'set-file-times 'ange-ftp 'ignore) 4362 (put 'set-file-times 'ange-ftp 'ignore)
4363 4363
4364 ;; Turn off RCS/SCCS processing to save time. 4364 ;; Turn off RCS/SCCS processing to save time.
4365 ;; This returns nil for any file name as argument. 4365 ;; This returns nil for any file name as argument.
4366 (put 'vc-registered 'ange-ftp 'null) 4366 (put 'vc-registered 'ange-ftp 'null)
4575 (result (ange-ftp-send-cmd host user 4575 (result (ange-ftp-send-cmd host user
4576 (list 'chmod mode name) 4576 (list 'chmod mode name)
4577 (format "doing chmod %s" 4577 (format "doing chmod %s"
4578 abbr)))) 4578 abbr))))
4579 (or (car result) 4579 (or (car result)
4580 (call-process 4580 (ange-ftp-error
4581 remote-shell-program 4581 host user (concat "CHMOD failed: " (cdr result))))))))
4582 nil t nil host dired-chmod-program mode name))))))
4583 rest)) 4582 rest))
4584 (setq ange-ftp-ls-cache-file nil) ;Stop confusing Dired. 4583 (setq ange-ftp-ls-cache-file nil) ;Stop confusing Dired.
4585 0) 4584 0)
4585
4586 (defun ange-ftp-set-file-modes (filename mode)
4587 (ange-ftp-call-chmod (list (format "%o" mode) filename)))
4586 4588
4587 ;; This is turned off because it has nothing properly to do 4589 ;; This is turned off because it has nothing properly to do
4588 ;; with dired. It could be reasonable to adapt this to 4590 ;; with dired. It could be reasonable to adapt this to
4589 ;; replace ange-ftp-copy-file. 4591 ;; replace ange-ftp-copy-file.
4590 4592