From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Marshall Newsgroups: gmane.emacs.bugs Subject: bug#26011: 26.0.50; tramp should respect large-file-warning-threshold Date: Wed, 08 Mar 2017 12:46:57 +0000 Message-ID: <87efy8ue9q.fsf@ctlt579.codethink.co.uk> References: <87pohtuq0e.fsf@ctlt579.codethink.co.uk> <87y3whnhxu.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488977296 28688 195.159.176.226 (8 Mar 2017 12:48:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2017 12:48:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 26011@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 08 13:48:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clb0h-0006KA-Ht for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 13:48:07 +0100 Original-Received: from localhost ([::1]:56021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clb0m-0003jp-0Z for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 07:48:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clb0f-0003jZ-LN for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 07:48:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clb0c-0002Xd-Jf for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 07:48:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47277) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1clb0c-0002XX-GQ for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 07:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1clb0c-0006bl-29 for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 07:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Marshall Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2017 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26011 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26011-submit@debbugs.gnu.org id=B26011.148897722725337 (code B ref 26011); Wed, 08 Mar 2017 12:48:02 +0000 Original-Received: (at 26011) by debbugs.gnu.org; 8 Mar 2017 12:47:07 +0000 Original-Received: from localhost ([127.0.0.1]:45476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clazi-0006ab-Rz for submit@debbugs.gnu.org; Wed, 08 Mar 2017 07:47:07 -0500 Original-Received: from imap0.codethink.co.uk ([185.43.218.159]:34073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clazh-0006a7-By for 26011@debbugs.gnu.org; Wed, 08 Mar 2017 07:47:06 -0500 Original-Received: from imap1.codethink.co.uk ([176.9.8.82]) by imap0.codethink.co.uk with esmtps (Exim 4.84_2 #1 (Debian)) id 1claza-0000hX-Km; Wed, 08 Mar 2017 12:46:59 +0000 Original-Received: from 82-70-136-246.dsl.in-addr.zen.co.uk ([82.70.136.246] helo=ct-lt-579.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1claza-0003kI-8B; Wed, 08 Mar 2017 12:46:58 +0000 In-Reply-To: <87y3whnhxu.fsf@detlef> (Michael Albinus's message of "Tue, 07 Mar 2017 17:57:17 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130337 Archived-At: Michael Albinus writes: > Robert Marshall writes: > > Hi Robert, > >> If from dired you attempt to copy a file to a tramp ssh dired (I have >> dired-dwim-target set to t) and that file is very large, emacs will pause >> for some time and eventually stop with: >> >> tramp-file-name-handler: Memory exhausted--use C-x s then exit and >> restart Emacs >> >> If tramp is going to open the file and it is large I think it should >> warn the user (respecting large-file-warning-threshold?) rather than >> going ahead without confirmation and erroring with an alarming message! > > Well, this happens in case Tramp inserts the file into a temporary > buffer. What about this patch: > > diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el > index 071ef79..8561962 100644 > --- a/lisp/tramp-sh.el > +++ b/lisp/tramp-sh.el > @@ -2147,6 +2147,11 @@ file names." > First arg OP is either `copy' or `rename' and indicates the operation. > FILENAME is the source file, NEWNAME the target file. > KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME." > + ;; Check, whether file is too large. Emacs checks in `insert-file-1' > + ;; and `find-file-noselect', but that's not called here. > + (abort-if-file-too-large > + (tramp-compat-file-attribute-size (file-attributes (file-truename filename))) > + (symbol-name op) filename) > ;; We must disable multibyte, because binary data shall not be > ;; converted. We don't want the target file to be compressed, so we > ;; let-bind `jka-compr-inhibit' to t. `epa-file-handler' shall not > Yes that's better thank you, you still get the transient error if I continue (my file was 4Gig) but I guess it's too late to do anything else by the time it gets there Robert