[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "File exists, but cannot be read"
From: |
Michael Albinus |
Subject: |
Re: "File exists, but cannot be read" |
Date: |
Wed, 20 Oct 2010 08:27:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Gary <address@hidden> writes:
> Michael Albinus wrote:
>> Please set tramp-copy-size-limit to -1, and try it, again. You should
>> flush your connections first by "M-x tramp-cleanup-all-connections".
>
> Same effect (i.e. still "cannot be read").
You're right, there's still a bug. Please try the following patch (on
top of Tramp 2.1.20-pre, line numbers might differ):
--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp-2-1-stable/lisp/tramp.el.~2.814.2.2.~
2010-10-19 10:53:34.000000000 +0200
--- /home/albinus/src/tramp-2-1-stable/lisp/tramp.el 2010-10-20
08:17:29.000000000 +0200
***************
*** 8578,8631 ****
Otherwise, either a string is returned which contains a `%s' mark
to be used for the respective input or output file; or a Lisp
function cell is returned to be applied on a buffer."
! (let ((coding
! (with-connection-property vec prop
! (tramp-find-inline-encoding vec)
! (tramp-get-connection-property vec prop nil)))
! (prop1 (if (string-match "encoding" prop)
! "inline-compress" "inline-decompress"))
! compress)
! ;; The connection property might have been cached. So we must send
! ;; the script to the remote side - maybe.
! (when (and coding (symbolp coding) (string-match "remote" prop))
! (let ((name (symbol-name coding)))
! (while (string-match (regexp-quote "-") name)
! (setq name (replace-match "_" nil t name)))
! (tramp-maybe-send-script vec (symbol-value coding) name)
! (setq coding name)))
! (when coding
! ;; Check for the `compress' command.
! (setq compress (tramp-get-inline-compress vec prop1 size))
! ;; Return the value.
! (cond
! ((and compress (symbolp coding))
! (if (string-match "decompress" prop1)
`(lambda (beg end)
- (,coding beg end)
(let ((coding-system-for-write 'binary)
(coding-system-for-read 'binary))
(apply
! 'call-process-region (point-min) (point-max)
(car (split-string ,compress)) t t nil
! (cdr (split-string ,compress)))))
! `(lambda (beg end)
! (let ((coding-system-for-write 'binary)
! (coding-system-for-read 'binary))
! (apply
! 'call-process-region beg end
! (car (split-string ,compress)) t t nil
! (cdr (split-string ,compress))))
! (,coding (point-min) (point-max)))))
! ((symbolp coding)
! coding)
! ((and compress (string-match "decoding" prop))
! (format "(%s | %s >%%s)" coding compress))
! (compress
! (format "(%s <%%s | %s)" compress coding))
! ((string-match "decoding" prop)
! (format "%s >%%s" coding))
! (t
! (format "%s <%%s" coding))))))
(defun tramp-get-method-parameter (method param)
"Return the method parameter PARAM.
--- 8578,8634 ----
Otherwise, either a string is returned which contains a `%s' mark
to be used for the respective input or output file; or a Lisp
function cell is returned to be applied on a buffer."
! ;; We must catch the errors, because we want to return `nil', when
! ;; no inline coding is found.
! (ignore-errors
! (let ((coding
! (with-connection-property vec prop
! (tramp-find-inline-encoding vec)
! (tramp-get-connection-property vec prop nil)))
! (prop1 (if (string-match "encoding" prop)
! "inline-compress" "inline-decompress"))
! compress)
! ;; The connection property might have been cached. So we must
! ;; send the script to the remote side - maybe.
! (when (and coding (symbolp coding) (string-match "remote" prop))
! (let ((name (symbol-name coding)))
! (while (string-match (regexp-quote "-") name)
! (setq name (replace-match "_" nil t name)))
! (tramp-maybe-send-script vec (symbol-value coding) name)
! (setq coding name)))
! (when coding
! ;; Check for the `compress' command.
! (setq compress (tramp-get-inline-compress vec prop1 size))
! ;; Return the value.
! (cond
! ((and compress (symbolp coding))
! (if (string-match "decompress" prop1)
! `(lambda (beg end)
! (,coding beg end)
! (let ((coding-system-for-write 'binary)
! (coding-system-for-read 'binary))
! (apply
! 'call-process-region (point-min) (point-max)
! (car (split-string ,compress)) t t nil
! (cdr (split-string ,compress)))))
`(lambda (beg end)
(let ((coding-system-for-write 'binary)
(coding-system-for-read 'binary))
(apply
! 'call-process-region beg end
(car (split-string ,compress)) t t nil
! (cdr (split-string ,compress))))
! (,coding (point-min) (point-max)))))
! ((symbolp coding)
! coding)
! ((and compress (string-match "decoding" prop))
! (format "(%s | %s >%%s)" coding compress))
! (compress
! (format "(%s <%%s | %s)" compress coding))
! ((string-match "decoding" prop)
! (format "%s >%%s" coding))
! (t
! (format "%s <%%s" coding)))))))
(defun tramp-get-method-parameter (method param)
"Return the method parameter PARAM.
--8<---------------cut here---------------end--------------->8---
Best regards, Michael.