tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to open or save remote files using Tramp.


From: Michael Albinus
Subject: Re: Unable to open or save remote files using Tramp.
Date: Tue, 17 May 2011 15:53:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

yary <address@hidden> writes:

> SunOS 5.9 is still in use at a few enterprises- at least it is what is
> what Safeway Inc is using, and I'm unrelated to the original poster.
> End of support for it is in 2014. And I've tried to use "head -c"
> there as well and been stymied, I wonder what an alternative is? "dd"
> is available on that system:
>
> dd bs=1 count=n<input_file  2>/dev/null
>
> might do.

Nice idea, dd shall be available on all remote machines running a
shell. I have changed the implementation in Tramp 2.2 like this:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp.el.~2.836~       2011-05-17 
15:18:04.375029407 +0200
--- /home/albinus/src/tramp/lisp/tramp.el       2011-05-17 13:43:04.610692276 
+0200
***************
*** 2838,2853 ****
                 v
                 (cond
                  ((and beg end)
!                  (format "tail -c +%d %s | head -c +%d >%s"
!                          (1+ beg) (tramp-shell-quote-argument localname)
                           (- end beg) remote-copy))
                  (beg
!                  (format "tail -c +%d %s >%s"
!                          (1+ beg) (tramp-shell-quote-argument localname)
                           remote-copy))
                  (end
!                  (format "head -c +%d %s >%s"
!                          (1+ end) (tramp-shell-quote-argument localname)
                           remote-copy)))))
  
              ;; `insert-file-contents-literally' takes care to avoid
--- 2838,2853 ----
                 v
                 (cond
                  ((and beg end)
!                  (format "dd bs=1 skip=%d if=%s count=%d of=%s"
!                          beg (tramp-shell-quote-argument localname)
                           (- end beg) remote-copy))
                  (beg
!                  (format "dd bs=1 skip=%d if=%s of=%s"
!                          beg (tramp-shell-quote-argument localname)
                           remote-copy))
                  (end
!                  (format "dd bs=1 count=%d if=%s of=%s"
!                          end (tramp-shell-quote-argument localname)
                           remote-copy)))))
  
              ;; `insert-file-contents-literally' takes care to avoid
--8<---------------cut here---------------end--------------->8---

Shall be applicable also in Tramp 2.1, with adapted line numbers.
Santosh, could you please test it (with enabled vc backends)?

> -y

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]