From: Sean Devlin <spd@toadstyle.org>
To: 40156@debbugs.gnu.org
Subject: bug#40156: 26.3; append-to-file does not work on nonexistent file over ssh
Date: Fri, 20 Mar 2020 19:32:20 -0400 [thread overview]
Message-ID: <D859A1C8-7F6F-4F07-99B8-38BAEC23FDC6@toadstyle.org> (raw)
In-Reply-To: <34570465-5AD0-4A4A-B862-08E5DF18E8B5@toadstyle.org>
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!
next prev parent reply other threads:[~2020-03-20 23:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 21:14 bug#40156: 26.3; append-to-file does not work on nonexistent file over ssh Sean Devlin
2020-03-20 23:32 ` Sean Devlin [this message]
2020-03-21 9:30 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D859A1C8-7F6F-4F07-99B8-38BAEC23FDC6@toadstyle.org \
--to=spd@toadstyle.org \
--cc=40156@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.