[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#40156: 26.3; append-to-file does not work on nonexistent file over s
From: |
Michael Albinus |
Subject: |
bug#40156: 26.3; append-to-file does not work on nonexistent file over ssh |
Date: |
Sat, 21 Mar 2020 10:30:54 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Version: 27.2
Sean Devlin <spd@toadstyle.org> writes:
> Hi folks,
Hi Sean,
> I did a little digging, and I think the problem is in
> tramp-sh-handle-write-region around line 3240:
>
>> ;; If `append' is non-nil, we copy the file locally, and let
>> ;; the native `write-region' implementation do the job.
>> (when append (copy-file filename tmpfile 'ok))
>
> It looks like copy-file fails if filename doesn’t exist. Adding a test
> for file existence (i.e. file-exists-p) to the condition seems to
> solve the problem, though admittedly I only tested for my own narrow
> use case.
Thanks, and yes, your analysis is correct. I've committed a respective
patch to Emacs master. I've extended also tramp-tests.el
accordingly. The patch is appended.
Since Emacs 27.1 is already in pretest, I haven't applied it there. The
next Tramp release in GNU ELPA, 2.4.3.3, will contain the patch. It is
expected end of March.
> Thanks!
Best regards, Michael.
txt_h4Eh93C0z.txt
Description: Text Data