[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
bug#40156: 26.3; append-to-file does not work on nonexistent file over ssh
Sat, 21 Mar 2020 10:30:54 +0100
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Sean Devlin <address@hidden> writes:
> Hi folks,
> 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, 188.8.131.52, will contain the patch. It is
expected end of March.
Best regards, Michael.
Description: Text Data