From: Michael Albinus Date: Tue, 17 May 2011 12:47:55 +0000 (+0200) Subject: * net/tramp.el (tramp-handle-insert-file-contents): Use "dd" X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~239^2~14^2^2~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7c1d9aa0bd508b0b3e0506bca7384dc41cfe7484;p=emacs.git * net/tramp.el (tramp-handle-insert-file-contents): Use "dd" instead of "head" and "tail". There were problems with SunOS 5.9, and it performs better. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 844fcaad833..79427663988 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-05-17 Michael Albinus + + * net/tramp.el (tramp-handle-insert-file-contents): Use "dd" + instead of "head" and "tail". There were problems with SunOS 5.9, + and it performs better. + 2011-05-17 Glenn Morris * mail/mail-utils.el (mail-dont-reply-to): Silence compiler. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 693e082ecc8..bc831c3b596 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2838,16 +2838,16 @@ User is always nil." v (cond ((and beg end) - (format "tail -c +%d %s | head -c +%d >%s" - (1+ beg) (tramp-shell-quote-argument localname) + (format "dd bs=1 skip=%d if=%s count=%d of=%s" + beg (tramp-shell-quote-argument localname) (- end beg) remote-copy)) (beg - (format "tail -c +%d %s >%s" - (1+ beg) (tramp-shell-quote-argument localname) + (format "dd bs=1 skip=%d if=%s of=%s" + beg (tramp-shell-quote-argument localname) remote-copy)) (end - (format "head -c +%d %s >%s" - (1+ end) (tramp-shell-quote-argument localname) + (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