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: Santosh Navale
Subject: Re: Unable to open or save remote files using Tramp.
Date: Tue, 17 May 2011 09:06:48 -0500

Hi Michael,

Thanks for the suggestion. I will try it and let you know.
I have a question, it might sound stupid. How do I edit tramp.el. Where do I find the file. The tramp I use is inbuilt into Emacs. So if you could tell me how to make these changes I will start.

Thanks
Santosh

On Tue, May 17, 2011 at 8:53 AM, Michael Albinus <address@hidden> wrote:
yary <not.com@gmail.com> 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]